handle invoice query param in send

This commit is contained in:
Paul Miller
2023-12-12 13:13:17 -06:00
parent efd17e53be
commit dc18a38d22

View File

@@ -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 (