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:
@ -21,6 +21,7 @@
|
||||
import Reviews from "../info/Reviews.svelte";
|
||||
import MapAi from "../info/MapAI.svelte";
|
||||
import RequiresCapability from "../RequiresCapability.svelte";
|
||||
import { saved, saveLocations } from "$lib/saved.svelte";
|
||||
|
||||
// let { feature }: { feature: Feature } = $props();
|
||||
|
||||
@ -170,10 +171,12 @@
|
||||
<Button
|
||||
variant="outline"
|
||||
onclick={() => {
|
||||
localStorage.setItem(
|
||||
"saved.home",
|
||||
JSON.stringify({ lat, lon: lng }),
|
||||
);
|
||||
// localStorage.setItem(
|
||||
// "saved.home",
|
||||
// JSON.stringify({ lat, lon: lng }),
|
||||
// );
|
||||
saved.home = { lat, lon: lng };
|
||||
saveLocations();
|
||||
}}
|
||||
>
|
||||
<HomeIcon />
|
||||
@ -182,10 +185,12 @@
|
||||
<Button
|
||||
variant="outline"
|
||||
onclick={() => {
|
||||
localStorage.setItem(
|
||||
"saved.work",
|
||||
JSON.stringify({ lat, lon: lng }),
|
||||
);
|
||||
// localStorage.setItem(
|
||||
// "saved.work",
|
||||
// JSON.stringify({ lat, lon: lng }),
|
||||
// );
|
||||
saved.work = { lat, lon: lng };
|
||||
saveLocations();
|
||||
}}
|
||||
>
|
||||
<BriefcaseIcon />
|
||||
|
||||
Reference in New Issue
Block a user