diff options
| author | Adam Soltys <[email protected]> | 2023-02-08 10:52:55 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-02-08 10:52:55 -0800 |
| commit | a0170af9e15405396c09d54bc53a7e82e2fb9169 (patch) | |
| tree | 5511cb9b09528fdd03b2013c67c120f0976b39f0 | |
| parent | 6dbb844ddca24f37b3db804e52c1384a2b5c8485 (diff) | |
| download | coinos-ui-a0170af9e15405396c09d54bc53a7e82e2fb9169.tar.gz coinos-ui-a0170af9e15405396c09d54bc53a7e82e2fb9169.zip | |
handle classic payments better
| -rw-r--r-- | src/routes/(app)/[username]/payments/[...page]/+page.svelte | 9 | ||||
| -rw-r--r-- | src/routes/(app)/send/[...text]/+page.server.js | 18 | ||||
| -rw-r--r-- | static/images/classic.png | bin | 0 -> 96810 bytes |
3 files changed, 23 insertions, 4 deletions
diff --git a/src/routes/(app)/[username]/payments/[...page]/+page.svelte b/src/routes/(app)/[username]/payments/[...page]/+page.svelte index 7161f50c..db591e01 100644 --- a/src/routes/(app)/[username]/payments/[...page]/+page.svelte +++ b/src/routes/(app)/[username]/payments/[...page]/+page.svelte @@ -15,7 +15,8 @@ internal: 'internal', bitcoin: 'bitcoin', lightning: 'lightning', - pot: 'pot' + pot: 'pot', + classic: 'classic' }; let { start, end, user } = data; @@ -187,6 +188,12 @@ <div class="my-auto ml-1 text-secondary">{p.with.username}</div> </div> </a> + {:else if p.type === types.classic} + <img + src="/images/classic.png" + class="w-24 border-4 border-transparent" + alt="Bitcoin" + /><div class="my-auto">{p.memo}</div> {:else} <div class="text-secondary flex"> {#if p.type === types.lightning} diff --git a/src/routes/(app)/send/[...text]/+page.server.js b/src/routes/(app)/send/[...text]/+page.server.js index 096c60e9..4c2776f5 100644 --- a/src/routes/(app)/send/[...text]/+page.server.js +++ b/src/routes/(app)/send/[...text]/+page.server.js @@ -23,7 +23,7 @@ let parse = async (t, host) => { if (t.endsWith('@classic')) { ({ uuid: id } = await get(`/invoice/classic/${t.replace('@classic', '')}`)); - if (id) throw redirect(307, `/send/${id}`); + if (id) throw redirect(307, `/send/invoice/${id}`); } if (t.includes('/pot')) throw redirect(307, t.substring(t.indexOf('/pot'))); @@ -58,17 +58,29 @@ let parse = async (t, host) => { // user try { user = await get(`/users/${t}`); - if (user.anon) user = null; + if (user.anon) user = null; } catch (e) {} if (user) throw redirect(307, `/send/user/${t}`); + // pot let pot; try { pot = await get(`/pot/${t}`); - } catch (e) {} + console.log(pot); + } catch (e) { + } if (pot) throw redirect(307, `/send/pot/${t}`); + + // invoice + let invoice; + try { + invoice = await get(`/invoice/${t}`); + } catch (e) { + } + + if (invoice) throw redirect(307, `/send/invoice/${invoice.hash}`); }; export async function load({ cookies, params, request, url }) { diff --git a/static/images/classic.png b/static/images/classic.png Binary files differnew file mode 100644 index 00000000..5c263a38 --- /dev/null +++ b/static/images/classic.png |
