add simple debug prompt to make it easier to debug on mobile devices
This commit is contained in:
parent
6a962f2fba
commit
8b14ff2c96
1 changed files with 29 additions and 2 deletions
|
@ -4,10 +4,37 @@
|
||||||
import { logOut } from "../../auth";
|
import { logOut } from "../../auth";
|
||||||
import { maybeModalFade, maybeModalFly } from "../../animations";
|
import { maybeModalFade, maybeModalFly } from "../../animations";
|
||||||
import request from "../../request";
|
import request from "../../request";
|
||||||
import { apiRoute } from "../../storage";
|
import { apiRoute, getItem } from "../../storage";
|
||||||
|
|
||||||
const close = () => overlayStore.close("settings");
|
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 = () => {
|
const doLogout = () => {
|
||||||
close();
|
close();
|
||||||
logOut();
|
logOut();
|
||||||
|
@ -70,7 +97,7 @@
|
||||||
|
|
||||||
<div class="modal-backdrop" transition:maybeModalFade on:click="{ close }">
|
<div class="modal-backdrop" transition:maybeModalFade on:click="{ close }">
|
||||||
<div class="modal" class:large-settings="{ !$smallViewport }" transition:maybeModalFly on:click|stopPropagation>
|
<div class="modal" class:large-settings="{ !$smallViewport }" transition:maybeModalFly on:click|stopPropagation>
|
||||||
<span class="input-label">Account</span>
|
<span class="input-label" on:click={ doDeveloper }>Account</span>
|
||||||
<div class="settings-card full-width">
|
<div class="settings-card full-width">
|
||||||
<AtSignIcon />
|
<AtSignIcon />
|
||||||
<span class="h5 top-bar-heading">{ $userInfoStore ? $userInfoStore.username : "" }</span>
|
<span class="h5 top-bar-heading">{ $userInfoStore ? $userInfoStore.username : "" }</span>
|
||||||
|
|
Loading…
Reference in a new issue