From 003b03511326b8ac728cd6364c718e10984aeda7 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Mon, 18 Dec 2023 13:08:31 +0100 Subject: [PATCH] chore: show toast error on make invoice call --- src/app/screens/MakeInvoice/index.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/screens/MakeInvoice/index.tsx b/src/app/screens/MakeInvoice/index.tsx index c704ab659d..cf0062e7ad 100644 --- a/src/app/screens/MakeInvoice/index.tsx +++ b/src/app/screens/MakeInvoice/index.tsx @@ -7,6 +7,7 @@ import TextField from "@components/form/TextField"; import React, { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import ScreenHeader from "~/app/components/ScreenHeader"; +import toast from "~/app/components/Toast"; import { useSettings } from "~/app/context/SettingsContext"; import { useNavigationState } from "~/app/hooks/useNavigationState"; import { USER_REJECTED_ERROR } from "~/common/constants"; @@ -91,6 +92,7 @@ function MakeInvoice() { }); msg.reply(response); } catch (e) { + if (e instanceof Error) toast.error(`${tCommon("error")}: ${e.message}`); console.error(e); } finally { setLoading(false);