diff options
| -rw-r--r-- | src/components/Balance.svelte | 8 | ||||
| -rw-r--r-- | src/components/Pin.svelte | 10 | ||||
| -rw-r--r-- | src/lib/socket.js | 2 | ||||
| -rw-r--r-- | src/lib/store.js | 1 | ||||
| -rw-r--r-- | src/routes/(app)/+layout.svelte | 2 |
5 files changed, 13 insertions, 10 deletions
diff --git a/src/components/Balance.svelte b/src/components/Balance.svelte index 06a5adc9..4d5ac6bd 100644 --- a/src/components/Balance.svelte +++ b/src/components/Balance.svelte @@ -1,4 +1,5 @@ <script> + import Icon from "$comp/Icon.svelte"; import Pin from "$comp/Pin.svelte"; import { f, s, sat, sats } from "$lib/utils"; import { pin } from "$lib/store"; @@ -15,8 +16,11 @@ <div class="space-y-2"> {#if user.haspin && !$pin} <button - class="text-xl rounded-2xl border py-5 px-6 hover:opacity-80 min-w-[72px] bg-black text-white font-bold" - on:click={() => (show = true)}>{$t("user.showBalance")}</button + class="flex gap-2 text-xl rounded-2xl border py-5 px-6 hover:opacity-80 bg-black text-white font-bold" + on:click={() => (show = true)} + > + <Icon icon="eye" style="w-8 invert my-auto" /> + <div class="my-auto">{$t("user.showBalance")}</div></button > {:else} <div class="text-5xl font-bold tabular-nums"> diff --git a/src/components/Pin.svelte b/src/components/Pin.svelte index df545014..d2a82d35 100644 --- a/src/components/Pin.svelte +++ b/src/components/Pin.svelte @@ -2,7 +2,7 @@ import { t } from "$lib/translations"; import { post, success, fail, focus, setCookie } from "$lib/utils"; import Pinpad from "$comp/Pinpad.svelte"; - import { pin, user } from "$lib/store"; + import { pin } from "$lib/store"; import { onMount } from "svelte"; export let value = ""; @@ -20,6 +20,8 @@ let loaded; onMount(() => setTimeout(() => (loaded = true), 500)); + let locktime = 30 * 60; + $: loaded && checkPin(p); let checkPin = async (p) => { if (p?.length !== 6) return; @@ -32,7 +34,7 @@ if (result) { if (notify) success("Pin confirmed"); - if ($user.locktime) setCookie("pin", p, $user.locktime); + if (locktime) setCookie("pin", p, locktime); $pin = p; } else { fail("Invalid pin"); @@ -52,11 +54,11 @@ <Pinpad bind:v={p} {cancel} /> <div> - <label class="font-bold">{$t("user.settings.rememberFor")}</label> + <label for="locktime" class="font-bold">{$t("user.settings.rememberFor")}</label> <select name="locktime" class="select-styles block py-3 w-full" - bind:value={$user.locktime} + bind:value={locktime} > <option value={30}>30 {$t("user.settings.seconds")}</option> <option value={5 * 60}>5 {$t("user.settings.minutes")}</option> diff --git a/src/lib/socket.js b/src/lib/socket.js index 8d8adb77..f6a6893b 100644 --- a/src/lib/socket.js +++ b/src/lib/socket.js @@ -1,5 +1,5 @@ import { get } from "svelte/store"; -import { event, invoice, request, newPayment, last, user } from "$lib/store"; +import { event, invoice, request, newPayment, last } from "$lib/store"; import { success, sat } from "$lib/utils"; import { PUBLIC_SOCKET } from "$env/static/public"; import { invalidate } from "$app/navigation"; diff --git a/src/lib/store.js b/src/lib/store.js index cd5f471b..6245fb76 100644 --- a/src/lib/store.js +++ b/src/lib/store.js @@ -54,6 +54,5 @@ export let rate = writable(); export let request = writable(); export let requestRedirect = writable(); export let token = persistSession("token"); -export let user = writable(); export let ndef = writable(); export let showQr = persistLocal("showQr"); diff --git a/src/routes/(app)/+layout.svelte b/src/routes/(app)/+layout.svelte index dce7abae..28750863 100644 --- a/src/routes/(app)/+layout.svelte +++ b/src/routes/(app)/+layout.svelte @@ -10,7 +10,6 @@ passwordPrompt, password, pin, - user as u, } from "$lib/store"; import { page } from "$app/stores"; import { browser } from "$app/environment"; @@ -40,7 +39,6 @@ $: update(data); let update = (data) => { ({ rate, user, subject, token, rates } = data); - if (browser) $u = user; }; onMount(async () => { |
