diff --git a/frontend/src/components/overlays/Settings.svelte b/frontend/src/components/overlays/Settings.svelte index 9dc3434..f1bc9cb 100644 --- a/frontend/src/components/overlays/Settings.svelte +++ b/frontend/src/components/overlays/Settings.svelte @@ -4,10 +4,37 @@ import { logOut } from "../../auth"; import { maybeModalFade, maybeModalFly } from "../../animations"; import request from "../../request"; - import { apiRoute } from "../../storage"; + import { apiRoute, getItem } from "../../storage"; const close = () => overlayStore.close("settings"); + const doDeveloper = () => { + overlayStore.open("prompt", { + heading: "", + valueName: "", + async onSubmit(value) { + const parts = value.split("##"); + if (parts.length < 1) { + return; + } + + const respond = (value) => { + overlayStore.close("prompt"); + overlayStore.open("toast", { message: value }); + }; + + switch (parts[0]) { + case "storage.getItem": { + return respond(getItem(parts[1])); + } + default: { + return respond("Error: unknown operator"); + } + } + }, + }); + }; + const doLogout = () => { close(); logOut(); @@ -70,7 +97,7 @@