diff --git a/src/routes/Send.tsx b/src/routes/Send.tsx index 3fa04ae9..fa20fac0 100644 --- a/src/routes/Send.tsx +++ b/src/routes/Send.tsx @@ -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, @@ -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 @@ -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 (