aboutsummaryrefslogtreecommitdiffstats
path: root/src/components
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-11-08 15:45:56 -0800
committerAdam Soltys <[email protected]>2024-11-08 15:45:56 -0800
commitb80f2993ec115533e1ddfba793277cdbe1c7ef4d (patch)
tree25dcc0fdf47d705a3b72899a861e34f5c38960b9 /src/components
parent3468d9cab22cd69d6889187801a63900c7282493 (diff)
downloadcoinos-ui-svelte-5.tar.gz
coinos-ui-svelte-5.zip
stop propagationsvelte-5
Diffstat (limited to 'src/components')
-rw-r--r--src/components/Balance.svelte12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/components/Balance.svelte b/src/components/Balance.svelte
index 91463f7e..e5f62d19 100644
--- a/src/components/Balance.svelte
+++ b/src/components/Balance.svelte
@@ -1,5 +1,5 @@
<script>
- import { preventDefault } from 'svelte/legacy';
+ import { preventDefault } from "svelte/legacy";
import Icon from "$comp/Icon.svelte";
import Pin from "$comp/Pin.svelte";
@@ -9,6 +9,11 @@
let show = $state();
let { user, rate, balance } = $props();
+ let toggleShow = (e) => {
+ e.preventDefault();
+ e.stopPropagation();
+ show = !show;
+ };
</script>
{#if show && user.haspin && $pin?.length !== 6}
@@ -17,10 +22,7 @@
<div>
{#if user.haspin && !$pin}
- <button
- onclick={preventDefault(() => (show = true))}
- class="flex gap-2 text-xl"
- >
+ <button onclick={toggleShow} class="flex gap-2 text-xl">
<Icon icon="eye-off" style="w-8 my-auto" />
<div class="my-auto">{$t("user.showBalance")}</div>
</button>