feat!: improve saving locations
Shows saved home and work locations with a marker on the map and provides a better API for saved locations opening room for more locations in the future BREAKING CHANGE: no longer uses saved.home, saved.work localStorage entries, locations need to be re-entered to use the saved entry instead
This commit is contained in:
7
src/lib/saved.svelte.ts
Normal file
7
src/lib/saved.svelte.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export const saved: Record<string, WorldLocation> = $state(
|
||||
JSON.parse(localStorage.getItem("saved") ?? "{}"),
|
||||
);
|
||||
|
||||
export function saveLocations() {
|
||||
localStorage.setItem("saved", JSON.stringify(saved));
|
||||
}
|
||||
Reference in New Issue
Block a user