From a654a1cb88313bdba9d20d79861f4b682f15c34f Mon Sep 17 00:00:00 2001 From: Fog3211 Date: Sun, 16 Apr 2023 00:39:31 +0800 Subject: [PATCH] fix: toast overload max size error (#1531) Co-authored-by: Fog3211 <23151576+Fog3211@users.noreply.github.com> --- web/src/components/CreateResourceDialog.tsx | 2 +- web/src/components/MemoEditor.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/components/CreateResourceDialog.tsx b/web/src/components/CreateResourceDialog.tsx index f9693a26..ddef0130 100644 --- a/web/src/components/CreateResourceDialog.tsx +++ b/web/src/components/CreateResourceDialog.tsx @@ -134,7 +134,7 @@ const CreateResourceDialog: React.FC = (props: Props) => { } } catch (error: any) { console.error(error); - toast.error(error.response.data.message); + toast.error(typeof error === "string" ? error : error.response.data.message); } if (onConfirm) { diff --git a/web/src/components/MemoEditor.tsx b/web/src/components/MemoEditor.tsx index dd8dffee..c06dc626 100644 --- a/web/src/components/MemoEditor.tsx +++ b/web/src/components/MemoEditor.tsx @@ -182,7 +182,7 @@ const MemoEditor = () => { resource = await resourceStore.createResourceWithBlob(file); } catch (error: any) { console.error(error); - toast.error(error.response.data.message); + toast.error(typeof error === "string" ? error : error.response.data.message); } setState((state) => {