DigitalCommons / land-explorer-front-end

React app for the Land Explorer front end
http://landexplorer.cc
GNU Affero General Public License v3.0
1 stars 0 forks source link

[Social Farms & Gardens-Spring-24] Reload map on refresh #316

Closed lin-d-hop closed 5 months ago

lin-d-hop commented 5 months ago

PLease track time for this bug under 'Social Farms & Gardens-Spring-24' on clockify

Description

When you refresh on LX the UI reloads to a new and unsaved map. As we develop more features around the map as document tools users will increasingly be using saved maps and thus a refresh in this way is annoying. It would be great to refresh and reload the map that the user is currently editing.

From Rohit on Element: I think this would be quite easy to do (about 1-2 hours work), by saving the current map ID in the browser's sessionStorage, which persists over site reloads but then gets wiped when the tab is closed

Acceptance Criteria

ms0ur1s commented 5 months ago

Ready for review. Thanks @rogup, the only difficulty I encountered was forgetting the sessionStorage variable is saved as a string, when comparing it to mapId 😅.

https://www.awesomescreenshot.com/video/27109423?key=3e34378d16d4e7279feb08028f0d9c09

lin-d-hop commented 4 months ago

Tested a few different maps and actions. LGTM :)