Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

fix: toast overload max size error (#1531)

Fog3211a654a1cb8831
diff --git a/web/src/components/CreateResourceDialog.tsx b/web/src/components/CreateResourceDialog.tsx
index f9693a26a..ddef0130d 100644
--- a/web/src/components/CreateResourceDialog.tsx
+++ b/web/src/components/CreateResourceDialog.tsx
@@ -134,7 +134,7 @@ const CreateResourceDialog: React.FC<Props> = (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 dd8dffee7..c06dc6262 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) => {