From c9175405f925d816854924bbee6fe82be6b1bf48 Mon Sep 17 00:00:00 2001 From: DanGould Date: Thu, 21 Mar 2024 17:19:38 -0400 Subject: [PATCH 1/3] Encode pj= in unifiedQr --- src/routes/Receive.tsx | 3 ++- src/utils/objectToSearchParams.ts | 16 +++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/routes/Receive.tsx b/src/routes/Receive.tsx index 76af57c8..c6e0d9de 100644 --- a/src/routes/Receive.tsx +++ b/src/routes/Receive.tsx @@ -260,7 +260,8 @@ export function Receive() { const params = objectToSearchParams({ amount: raw?.btc_amount, - lightning: raw?.invoice + lightning: raw?.invoice, + pj: raw?.pj, }); setLoading(false); diff --git a/src/utils/objectToSearchParams.ts b/src/utils/objectToSearchParams.ts index 84434cde..20e257fb 100644 --- a/src/utils/objectToSearchParams.ts +++ b/src/utils/objectToSearchParams.ts @@ -5,11 +5,17 @@ export function objectToSearchParams< Object.entries(obj) .filter(([_, value]) => value !== undefined) // Value shouldn't be null we just filtered it out but typescript is dumb - .map(([key, value]) => - value - ? `${encodeURIComponent(key)}=${encodeURIComponent(value)}` - : "" - ) + .map(([key, value]) => { + if (value) { + if (key === "pj") { + return `${key}=${value}` + } else { + return `${encodeURIComponent(key)}=${encodeURIComponent(value)}` + } + } else { + return "" + } + }) .join("&") ); } From 729cc0cb61fd7a473faa39ed1579f799682d6e25 Mon Sep 17 00:00:00 2001 From: DanGould Date: Tue, 26 Mar 2024 16:57:57 -0400 Subject: [PATCH 2/3] Encode ohttp= in unifiedQr --- src/routes/Receive.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/routes/Receive.tsx b/src/routes/Receive.tsx index c6e0d9de..450dddaa 100644 --- a/src/routes/Receive.tsx +++ b/src/routes/Receive.tsx @@ -262,6 +262,7 @@ export function Receive() { amount: raw?.btc_amount, lightning: raw?.invoice, pj: raw?.pj, + ohttp: raw?.ohttp, }); setLoading(false); From afe1b1d389540742ab7dd5c7382c5711444b8bfc Mon Sep 17 00:00:00 2001 From: DanGould Date: Sat, 6 Apr 2024 18:23:32 -0400 Subject: [PATCH 3/3] Show createResrouce txid even if it's not in wallet --- src/components/ActivityDetailsModal.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/ActivityDetailsModal.tsx b/src/components/ActivityDetailsModal.tsx index 1ed32510..ab99b189 100644 --- a/src/components/ActivityDetailsModal.tsx +++ b/src/components/ActivityDetailsModal.tsx @@ -520,8 +520,7 @@ export function ActivityDetailsModal(props: { } else { console.debug("reading tx: ", id()); const tx = await state.mutiny_wallet?.get_transaction(id()); - - return tx; + return tx !== null ? tx : id(); // if no tx found still show id } } catch (e) { console.error(e);