From dd49cb5e8754ee82fb2370b375db6b46a1eefd52 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 26 Nov 2024 20:54:49 -0800 Subject: warnings --- src/components/About.svelte | 22 +++---- src/components/Footer.svelte | 2 +- src/components/LandingHeader.svelte | 12 ++-- src/components/Lnurlp.svelte | 16 ++--- src/components/Lnurlw.svelte | 7 +- src/components/LocaleSelector.svelte | 10 ++- src/components/LocationsMap.svelte | 3 +- src/components/PasswordInput.svelte | 20 ++++++ src/components/Pinpad.svelte | 18 +++--- src/routes/(app)/send/invoice/[id]/+page.svelte | 19 ++---- src/routes/(app)/sent/[id]/+page.svelte | 6 +- src/routes/(app)/settings/security/+page.svelte | 32 +++------ src/routes/(static)/register/+page.server.ts | 13 ++-- src/routes/(static)/register/+page.svelte | 86 ++++++++++++------------- src/routes/+layout.svelte | 2 +- 15 files changed, 123 insertions(+), 145 deletions(-) create mode 100644 src/components/PasswordInput.svelte (limited to 'src') diff --git a/src/components/About.svelte b/src/components/About.svelte index 5f87e99a..1f02e20d 100644 --- a/src/components/About.svelte +++ b/src/components/About.svelte @@ -2,7 +2,6 @@ import { onMount } from "svelte"; import Icon from "$comp/Icon.svelte"; import Image from "$comp/Image.svelte"; - import LocationsMap from "$comp/LocationsMap.svelte"; import { t } from "$lib/translations"; let team = [ @@ -90,18 +89,17 @@ > {@html $t("about.locations.description")}

- - -
- +
+ + Map + - -
- + +
{/if} diff --git a/src/components/Footer.svelte b/src/components/Footer.svelte index 3af5f6a3..dad8aeab 100644 --- a/src/components/Footer.svelte +++ b/src/components/Footer.svelte @@ -23,7 +23,7 @@ >
diff --git a/src/components/LandingHeader.svelte b/src/components/LandingHeader.svelte index c20c80a0..f2c94ade 100644 --- a/src/components/LandingHeader.svelte +++ b/src/components/LandingHeader.svelte @@ -7,12 +7,7 @@ import DarkToggle from "$comp/DarkToggle.svelte"; import LocaleSelector from "$comp/LocaleSelector.svelte"; - let { - howItWorks, - faq, - about, - user - } = $props(); + let { howItWorks, faq, about, user } = $props(); let showMobileMenu = $state(false); let header = $state(); @@ -28,7 +23,7 @@ >
- import { run } from 'svelte/legacy'; + import { run } from "svelte/legacy"; import { t } from "$lib/translations"; import { enhance } from "$app/forms"; @@ -7,20 +7,12 @@ import Spinner from "$comp/Spinner.svelte"; import { pin } from "$lib/store"; - let { - data, - form, - send = $bindable(), - comment = $bindable() - } = $props(); + let { data, form, send = $bindable(), comment = $bindable() } = $props(); let { currency } = data.user; let { minSendable, maxSendable, commentAllowed, callback, metadata, rates } = data; - let rate; - run(() => { - rate = rates[currency]; - }); + let rate = $derived(rates[currency]); let amount = $state(Math.round(minSendable / 1000)), loading = $state(); @@ -63,7 +55,7 @@ class="w-full p-4 border rounded-xl h-32 text-xl" bind:value={comment} autocapitalize="none" -> + > {/if}
diff --git a/src/components/Lnurlw.svelte b/src/components/Lnurlw.svelte index 50aa1488..a9b6695a 100644 --- a/src/components/Lnurlw.svelte +++ b/src/components/Lnurlw.svelte @@ -1,6 +1,4 @@ diff --git a/src/components/LocationsMap.svelte b/src/components/LocationsMap.svelte index 36223b75..c47dbf49 100644 --- a/src/components/LocationsMap.svelte +++ b/src/components/LocationsMap.svelte @@ -263,6 +263,7 @@ >
{:else} diff --git a/src/components/PasswordInput.svelte b/src/components/PasswordInput.svelte new file mode 100644 index 00000000..5885304b --- /dev/null +++ b/src/components/PasswordInput.svelte @@ -0,0 +1,20 @@ + + + diff --git a/src/components/Pinpad.svelte b/src/components/Pinpad.svelte index 8f0fc3c2..0efdd471 100644 --- a/src/components/Pinpad.svelte +++ b/src/components/Pinpad.svelte @@ -1,6 +1,4 @@
diff --git a/src/routes/(app)/send/invoice/[id]/+page.svelte b/src/routes/(app)/send/invoice/[id]/+page.svelte index d2b3727c..f0811f2e 100644 --- a/src/routes/(app)/send/invoice/[id]/+page.svelte +++ b/src/routes/(app)/send/invoice/[id]/+page.svelte @@ -13,32 +13,23 @@ import Numpad from "$comp/Numpad.svelte"; import Spinner from "$comp/Spinner.svelte"; import { page } from "$app/stores"; - import { - btc, - sat, - post, - back, - f, - toFiat, - s, - sats, - focus, - } from "$lib/utils"; + import { btc, sat, post, back, f, toFiat, s, sats, focus } from "$lib/utils"; let { data, form } = $props(); let { invoice, rates, user } = $state(data); let { address, hash, payreq, user: recipient, tip } = $state(invoice); let { currency } = $state(user); + let { amount } = $state(form || invoice); - let amount = $state(form?.amount || invoice.amount); let rate = $derived( invoice.rate * (rates[user.currency] / rates[invoice.currency]), ); + let a = $state(), af = $state(), - fiat = $state(!amount); + fiat = $state(untrack(() => !amount)); - let amountFiat = $state(amount * (rate / sats)); + let amountFiat = $state((untrack(() => amount) * untrack(() => rate)) / sats); let setAmount = () => { amount = a; amountFiat = af; diff --git a/src/routes/(app)/sent/[id]/+page.svelte b/src/routes/(app)/sent/[id]/+page.svelte index 2eb1f18b..d973d35d 100644 --- a/src/routes/(app)/sent/[id]/+page.svelte +++ b/src/routes/(app)/sent/[id]/+page.svelte @@ -4,13 +4,13 @@ import Success from "$comp/Success.svelte"; let { data } = $props(); - let { amount, rate, tip, user } = $state(data); + let { rate, tip, user } = $state(data); let { currency, username } = user; - amount = Math.abs(amount); + let amount = $state(Math.abs(data.amount)); - +
diff --git a/src/routes/(app)/settings/security/+page.svelte b/src/routes/(app)/settings/security/+page.svelte index cc988d6c..d40439ac 100644 --- a/src/routes/(app)/settings/security/+page.svelte +++ b/src/routes/(app)/settings/security/+page.svelte @@ -1,12 +1,11 @@ {#if need2fa} @@ -185,11 +175,12 @@ -
- - -
+
+ @@ -218,7 +210,7 @@
{/if} -
+ - + aria-label="Randomize" + class="contents" + > +