From b6b3ba95b2821176113a079a405bab23acbcc2d3 Mon Sep 17 00:00:00 2001 From: ieow Date: Tue, 26 Nov 2024 12:41:57 +0800 Subject: [PATCH] fix: insufficient sol --- src/pages/wallet/Transfer.vue | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/pages/wallet/Transfer.vue b/src/pages/wallet/Transfer.vue index 1d5e8252..e694b90a 100644 --- a/src/pages/wallet/Transfer.vue +++ b/src/pages/wallet/Transfer.vue @@ -389,10 +389,17 @@ const confirmTransfer = async () => { }); } catch (error) { log.error(error); - showMessageModal({ - messageTitle: `${t("walletTransfer.submitFailed")}: ${(error as Error)?.message || t("walletSettings.somethingWrong")}`, - messageStatus: STATUS.ERROR, - }); + if ((error as Error).message.match("found no record of a prior credit")) { + showMessageModal({ + messageTitle: t("walletTransfer.insufficientSol"), + messageStatus: STATUS.ERROR, + }); + } else { + showMessageModal({ + messageTitle: `${t("walletTransfer.submitFailed")}: ${(error as Error)?.message || t("walletSettings.somethingWrong")}`, + messageStatus: STATUS.ERROR, + }); + } } };