Skip to content

Commit

Permalink
resolve fixed amount issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tompro committed Jan 22, 2024
1 parent 8c6030a commit 554433b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/routes/Receive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,15 @@ export function Receive() {
const [detailsOpen, setDetailsOpen] = createSignal(false);
const [detailsKind, setDetailsKind] = createSignal<HackActivityType>();
const [detailsId, setDetailsId] = createSignal<string>("");

const [lnUrlData, setLnUrlData] = createSignal<LnUrlData>();
const [fixedAmount, setFixedAmount] = createSignal(false);
const [lnUrlExecuted, setLnUrlExecuted] = createSignal(false);

if (state.lnUrlData) {
initLnUrlWithdrawal(state.lnUrlData);
}

const RECEIVE_FLAVORS = [
{
value: "unified",
Expand Down Expand Up @@ -182,6 +187,8 @@ export function Receive() {
setError("");
setFlavor(state.preferredInvoiceType);
setLnUrlData(undefined);
setLnUrlExecuted(false);
setFixedAmount(false);
}

function openDetailsModal() {
Expand Down Expand Up @@ -336,17 +343,10 @@ export function Receive() {
}
}

// If we got here from an LNUrl withdrawal request
onMount(() => {
if (state.lnUrlData) {
initLnUrlWithdrawal(state.lnUrlData);
actions.setScanResult(undefined);
actions.setLnUrlData(undefined);
}
});

function initLnUrlWithdrawal(lnUrlData: LnUrlData) {
console.log("handleLnUrlWithdrawal", lnUrlData.lnurl, lnUrlData.params);
actions.setScanResult(undefined);
actions.setLnUrlData(undefined);
setLnUrlData(lnUrlData);
setError("");
setFlavor("lightning");
Expand Down

0 comments on commit 554433b

Please sign in to comment.