aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/send
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-08-14 22:32:58 -0700
committerAdam Soltys <[email protected]>2023-08-14 22:32:58 -0700
commit1d55903cce0d1914ec21ff31d8ae2b4dcb4fa64d (patch)
tree090f3941fccc4a7532fe703a2b6eea313061ad5d /src/routes/(app)/send
parent1de7b98a219fc3872aa6218e7e9e78ab56803d5e (diff)
downloadcoinos-ui-1d55903cce0d1914ec21ff31d8ae2b4dcb4fa64d.tar.gz
coinos-ui-1d55903cce0d1914ec21ff31d8ae2b4dcb4fa64d.zip
more options link for using external wallets
Diffstat (limited to 'src/routes/(app)/send')
-rw-r--r--src/routes/(app)/send/invoice/[id]/+page.svelte22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/routes/(app)/send/invoice/[id]/+page.svelte b/src/routes/(app)/send/invoice/[id]/+page.svelte
index 1a73405e..554eef6f 100644
--- a/src/routes/(app)/send/invoice/[id]/+page.svelte
+++ b/src/routes/(app)/send/invoice/[id]/+page.svelte
@@ -1,16 +1,16 @@
<script>
import { onDestroy, onMount } from 'svelte';
import { t } from '$lib/translations';
- import { goto } from '$app/navigation';
+ import { goto, invalidateAll } from '$app/navigation';
import { pin } from '$lib/store';
import { enhance } from '$app/forms';
import { Avatar, Icon, Numpad, Spinner } from '$comp';
import { page } from '$app/stores';
- import { back, f, fiat as toFiat, s, sats } from '$lib/utils';
+ import { post, back, f, fiat as toFiat, s, sats } from '$lib/utils';
export let data;
export let form;
- let { address, rate, payreq, recipient, tip, rates, user } = data;
+ let { address, hash, rate, payreq, recipient, tip, rates, user } = data;
let { currency } = user;
let amount = form?.amount || data.amount;
@@ -27,6 +27,15 @@
let loading;
let submit = () => (loading = true);
+ let external = async () => {
+ let invoice = { type: 'lightning', amount };
+ let { hash } = await post(`/${recipient.username}/invoice`, {
+ invoice
+ });
+
+ goto(`/${recipient.username}/invoice/${hash}`, { invalidateAll: true });
+ };
+
$: rate = data.rate * (rates[user.currency] / rates[data.currency]);
$: update(form);
@@ -40,11 +49,11 @@
// try {
// let ndef = new NDEFReader();
// await ndef.scan();
- //
+ //
// ndef.addEventListener('readingerror', (e) => {
// console.log('nfc error', e);
// });
- //
+ //
// ndef.addEventListener('reading', ({ message, serialNumber }) => {
// console.log(message, serialNumber);
// });
@@ -130,4 +139,7 @@
{/if}
</div>
</form>
+ <div class="flex my-20">
+ <button class="mx-auto" on:click={external}>{$t('payments.moreOptions')}</button>
+ </div>
</div>