aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-11-10 20:14:38 -0800
committerAdam Soltys <[email protected]>2024-11-10 20:14:38 -0800
commit9478bb2ed1554be8c4dc75b8860fff4bf5214936 (patch)
tree64e7da57cc0448c220235615331ac98e1f451eb7
parent0566cfe418494761cfceee57754c4d8277346de0 (diff)
downloadcoinos-ui-9478bb2ed1554be8c4dc75b8860fff4bf5214936.tar.gz
coinos-ui-9478bb2ed1554be8c4dc75b8860fff4bf5214936.zip
fix pinpad
-rw-r--r--src/components/Pinpad.svelte21
-rw-r--r--src/routes/(static)/login/+page.svelte3
2 files changed, 7 insertions, 17 deletions
diff --git a/src/components/Pinpad.svelte b/src/components/Pinpad.svelte
index 72aaac81..8f0fc3c2 100644
--- a/src/components/Pinpad.svelte
+++ b/src/components/Pinpad.svelte
@@ -13,7 +13,10 @@
const numPad = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "C", "0", "<"];
- const handleInput = (n) => {
+ const handleInput = (e, n) => {
+ e.preventDefault();
+ e.stopPropagation();
+
v = (v || "").toString();
if (n === "C") return (v = "");
if (n === "<") return (v = v.length > 1 ? Math.floor(v / 10) : "");
@@ -70,22 +73,12 @@
<div class="grid grid-cols-3 gap-2 w-[300px] mx-auto grayscale">
{#each numPad as value}
{#if value === arrow}
- <button
- type="button"
- class="btn"
- onclick={((e) => e.preventDefault(),
- e.stopPropagation(),
- handleInput(value))}
- >
+ <button type="button" class="btn" onclick={(e) => handleInput(e, value)}>
<Left />
</button>
{:else}
- <button
- type="button"
- class="btn"
- onclick={((e) => e.preventDefault(),
- e.stopPropagation(),
- handleInput(value))}>{value}</button
+ <button type="button" class="btn" onclick={(e) => handleInput(e, value)}
+ >{value}</button
>
{/if}
{/each}
diff --git a/src/routes/(static)/login/+page.svelte b/src/routes/(static)/login/+page.svelte
index 17b69f5e..2b36dcfe 100644
--- a/src/routes/(static)/login/+page.svelte
+++ b/src/routes/(static)/login/+page.svelte
@@ -47,8 +47,6 @@
let revealPassword = $state(false);
async function handleSubmit(e) {
- console.log("SUBMITTING");
-
let data = new FormData(this);
let user = Object.fromEntries(data);
@@ -71,7 +69,6 @@
}
$effect(() => {
- console.log("TOKEN", token);
token?.length === 6 &&
tick().then(() => {
btn.click();