forked from MapComplete/MapComplete
Add a personal, configurable quest
This commit is contained in:
parent
9c42839f01
commit
7ec00a3301
21 changed files with 376 additions and 237 deletions
|
@ -1,13 +1,17 @@
|
|||
import {UIEventSource} from "../UI/UIEventSource";
|
||||
import {UIElement} from "../UI/UIElement";
|
||||
|
||||
export class LocalStorageSource {
|
||||
|
||||
static Get(key: string, defaultValue: string = undefined): UIEventSource<string> {
|
||||
|
||||
//*
|
||||
|
||||
if (UIElement.runningFromConsole) {
|
||||
|
||||
// ignore when running from the console
|
||||
return new UIEventSource<string>(defaultValue);
|
||||
/*/
|
||||
}
|
||||
|
||||
|
||||
const saved = localStorage.getItem(key);
|
||||
const source = new UIEventSource<string>(saved ?? defaultValue);
|
||||
|
||||
|
@ -16,6 +20,5 @@ export class LocalStorageSource {
|
|||
console.log("Wriging ", key, data)
|
||||
});
|
||||
return source;
|
||||
//*/
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue