From 2de78ad3fe44cceacec0e1f096fea38da8ac3e1d Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 3 Jan 2024 20:20:10 -0800 Subject: enable nfc --- src/routes/(app)/send/[...text]/+page.server.js | 4 ++-- src/routes/(app)/send/invoice/[id]/+page.svelte | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/routes/(app)/send') diff --git a/src/routes/(app)/send/[...text]/+page.server.js b/src/routes/(app)/send/[...text]/+page.server.js index a6b0c54d..ef05be16 100644 --- a/src/routes/(app)/send/[...text]/+page.server.js +++ b/src/routes/(app)/send/[...text]/+page.server.js @@ -33,11 +33,11 @@ let parse = async (t, host) => { if (t.includes("/fund")) redirect(307, t.substring(t.indexOf("/fund"))); + // lightning + if (t.toLowerCase().startsWith("lightning:")) t = t.toLowerCase().replace("lightning:", ""); if (t.toLowerCase().startsWith("lnurl")) redirect(307, `/ln/${t}`); if (t.includes(":")) t = t.split(":")[1]; - // lightning - if (t.toLowerCase().startsWith("lightning:")) t = t.toLowerCase().replace("lightning:", ""); if (t.toLowerCase().startsWith("ln")) { try { ({ id } = await get(`/invoice/${t}`)); diff --git a/src/routes/(app)/send/invoice/[id]/+page.svelte b/src/routes/(app)/send/invoice/[id]/+page.svelte index c2163a81..e857f717 100644 --- a/src/routes/(app)/send/invoice/[id]/+page.svelte +++ b/src/routes/(app)/send/invoice/[id]/+page.svelte @@ -57,7 +57,7 @@ }; // onMount(async () => { - // if (browser && window.NDEFReader) { + // if (browser && window.NDEFReader && user.nfc) { // try { // let ndef = new NDEFReader(); // await ndef.scan(); -- cgit v1.2.3