diff options
| author | Adam Soltys <[email protected]> | 2025-01-22 17:10:08 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-01-22 17:10:08 -0800 |
| commit | eaf9b3fa08282d89e3e40fefeccd83904185f8a2 (patch) | |
| tree | 4300eeb446b07c99f2e8c97c738e2ce97e66896d /src | |
| parent | 9385f77d3fb892dde418e25c46cb515978801921 (diff) | |
| download | coinos-ui-eaf9b3fa08282d89e3e40fefeccd83904185f8a2.tar.gz coinos-ui-eaf9b3fa08282d89e3e40fefeccd83904185f8a2.zip | |
settings logic tweak
Diffstat (limited to 'src')
| -rw-r--r-- | src/routes/(app)/send/[...text]/+page.svelte | 14 | ||||
| -rw-r--r-- | src/routes/(app)/settings/+layout.svelte | 18 |
2 files changed, 20 insertions, 12 deletions
diff --git a/src/routes/(app)/send/[...text]/+page.svelte b/src/routes/(app)/send/[...text]/+page.svelte index 23f39ddf..c423015a 100644 --- a/src/routes/(app)/send/[...text]/+page.svelte +++ b/src/routes/(app)/send/[...text]/+page.svelte @@ -72,19 +72,22 @@ <div class="flex gap-2"> <a href="/scan" class="contents"> <button type="button" class="btn !w-auto flex-grow"> - <iconify-icon noobserver icon="ph:camera-bold" width="32"></iconify-icon> + <iconify-icon noobserver icon="ph:camera-bold" width="32" + ></iconify-icon> {$t("user.send.scan")} </button> </a> <button type="button" class="btn !w-auto flex-grow" onclick={paste}> - <iconify-icon noobserver icon="ph:clipboard-text-bold" width="32"></iconify-icon> + <iconify-icon noobserver icon="ph:clipboard-text-bold" width="32" + ></iconify-icon> {$t("user.send.paste")} </button> </div> <button bind:this={el} type="submit" class="btn btn-accent"> - <iconify-icon noobserver icon="ph:paper-plane-right-bold" width="32"></iconify-icon> + <iconify-icon noobserver icon="ph:paper-plane-right-bold" width="32" + ></iconify-icon> <div class="my-auto">{$t("user.send.next")}</div> </button> @@ -97,7 +100,10 @@ <a href="/send/fund" class="block"> <button type="button" class="btn"> - <iconify-icon noobserver icon="ph:lightning-fill" class="text-yellow-300 text-2xl" + <iconify-icon + noobserver + icon="ph:lightning-fill" + class="text-yellow-300 text-2xl" ></iconify-icon> <div class="my-auto">{$t("payments.createFund")}</div> </button> diff --git a/src/routes/(app)/settings/+layout.svelte b/src/routes/(app)/settings/+layout.svelte index bc0d18f9..0b4ba90b 100644 --- a/src/routes/(app)/settings/+layout.svelte +++ b/src/routes/(app)/settings/+layout.svelte @@ -23,8 +23,8 @@ let { token, cookies, subscriptions } = $derived(data); let { tab } = $derived(data); - let { user } = $derived(form || data); - let prev = $derived({ ...user }); + let user = $derived({ ...data?.user, ...form?.user }); + let prev = $derived({ ...data.user }); let justUpdated; let throttledSuccess = () => { @@ -49,11 +49,13 @@ try { submitting = true; let body = new FormData(formElement); - let user = await fd({ - formData() { - return body; - }, - }); + form = { + user: await fd({ + formData() { + return body; + }, + }), + }; if (!user.pubkey || user.pubkey === prev.pubkey) { body.delete("pubkey"); @@ -119,7 +121,7 @@ }; try { - event = await sign(event, data.user); + event = await sign(event, user); send(event); } catch (e) { console.log(e); |
