mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2025-12-17 06:14:21 +01:00
Handle expired invoices
This commit is contained in:
committed by
Paul Miller
parent
97591ee2b1
commit
1c8a57d700
@@ -137,6 +137,7 @@ export default {
|
||||
error_clipboard: "Clipboard not supported",
|
||||
error_keysend: "Keysend failed",
|
||||
error_LNURL: "LNURL Pay failed",
|
||||
error_expired: "Invoice is expired",
|
||||
payment_pending: "Payment pending",
|
||||
payment_pending_description:
|
||||
"It's taking a while, but it's possible this payment may still go through. Please check 'Activity' for the current status.",
|
||||
|
||||
@@ -446,6 +446,11 @@ export function Send() {
|
||||
state.mutiny_wallet
|
||||
?.decode_invoice(source.invoice!)
|
||||
.then((invoice) => {
|
||||
if (invoice.expire <= Date.now() / 1000) {
|
||||
navigate("/search");
|
||||
throw new Error(i18n.t("send.error_expired"));
|
||||
}
|
||||
|
||||
if (invoice?.amount_sats) {
|
||||
setAmountSats(invoice.amount_sats);
|
||||
setIsAmtEditable(false);
|
||||
|
||||
Reference in New Issue
Block a user