aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/Pin.svelte
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-02-22 23:11:27 -0800
committerAdam Soltys <[email protected]>2024-02-22 23:11:27 -0800
commit3ab1bc1fcc96f78bcc3fb7bc6ff9f84fc75c7c41 (patch)
tree2025ed0f5ceafacd5d22fd90e7c4d997c3bf54a1 /src/components/Pin.svelte
parent87e5041209e2a2631cbe1a76cf9f07466a066748 (diff)
downloadcoinos-ui-3ab1bc1fcc96f78bcc3fb7bc6ff9f84fc75c7c41.tar.gz
coinos-ui-3ab1bc1fcc96f78bcc3fb7bc6ff9f84fc75c7c41.zip
default pin expiry
Diffstat (limited to 'src/components/Pin.svelte')
-rw-r--r--src/components/Pin.svelte10
1 files changed, 6 insertions, 4 deletions
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>