mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-25 12:05:13 +01:00
escape marker-set id when saving to local storage
This commit is contained in:
parent
76e3c4e758
commit
2f78f75a90
@ -61,7 +61,7 @@ export class MarkerSet extends Scene {
|
|||||||
this.markerSets.filter(markerSet => markerSet.listed).length > 0
|
this.markerSets.filter(markerSet => markerSet.listed).length > 0
|
||||||
},
|
},
|
||||||
saveState: () => {
|
saveState: () => {
|
||||||
setLocalStorage("markerset-" + this.data.id + "-visible", this.visible);
|
setLocalStorage(this.localStorageKey("visible"), this.visible);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ export class MarkerSet extends Scene {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (this.data.toggleable) {
|
if (this.data.toggleable) {
|
||||||
let storedVisible = getLocalStorage("markerset-" + this.data.id + "-visible");
|
let storedVisible = getLocalStorage(this.localStorageKey("visible"));
|
||||||
if (storedVisible !== undefined) {
|
if (storedVisible !== undefined) {
|
||||||
this.visible = !!storedVisible;
|
this.visible = !!storedVisible;
|
||||||
} else if (this.data.defaultHide) {
|
} else if (this.data.defaultHide) {
|
||||||
@ -229,4 +229,8 @@ export class MarkerSet extends Scene {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
localStorageKey(key) {
|
||||||
|
return "bluemap-markerset-" + encodeURIComponent(this.data.id) + "-" + key;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user