Skip to content

Commit

Permalink
handle invoice query param in send
Browse files Browse the repository at this point in the history
  • Loading branch information
futurepaul committed Dec 21, 2023
1 parent efd17e5 commit dc18a38
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/routes/Send.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Clipboard } from "@capacitor/clipboard";
import { Capacitor } from "@capacitor/core";
import { Contact, MutinyInvoice, TagItem } from "@mutinywallet/mutiny-wasm";
import { A, useNavigate } from "@solidjs/router";
import { A, useNavigate, useSearchParams } from "@solidjs/router";
import {
createEffect,
createMemo,
Expand Down Expand Up @@ -252,6 +252,7 @@ function Failure(props: { reason: string }) {
export function Send() {
const [state, actions] = useMegaStore();
const navigate = useNavigate();
const [params, setParams] = useSearchParams();
const i18n = useI18n();

// These can only be set by the user
Expand Down Expand Up @@ -336,6 +337,14 @@ export function Send() {
}
});

// send?invoice=... need to check for wallet because we can't parse until we have the wallet
createEffect(() => {
if (params.invoice && state.mutiny_wallet) {
parsePaste(params.invoice);
setParams({ invoice: undefined });
}
});

// Three suspiciously similar "max" values we want to compute
const maxOnchain = createMemo(() => {
return (
Expand Down

0 comments on commit dc18a38

Please sign in to comment.