From 4f222bca5c848883eb5743a8f9ca27e646bb42c1 Mon Sep 17 00:00:00 2001 From: zty Date: Fri, 17 Nov 2023 10:01:14 +0800 Subject: [PATCH] fix: keep content and query param on save when access token is invalid (#2524) fix: keep content on save when access token is invalid Co-authored-by: zty --- web/src/components/MemoEditor/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/components/MemoEditor/index.tsx b/web/src/components/MemoEditor/index.tsx index a1b7d980..83a5ddb5 100644 --- a/web/src/components/MemoEditor/index.tsx +++ b/web/src/components/MemoEditor/index.tsx @@ -326,6 +326,8 @@ const MemoEditor = (props: Props) => { }); filterStore.clearFilter(); } + editorRef.current?.setContent(""); + clearContentQueryParam(); } catch (error: any) { console.error(error); toast.error(error.response.data.message); @@ -348,8 +350,6 @@ const MemoEditor = (props: Props) => { ...prevState, resourceList: [], })); - editorRef.current?.setContent(""); - clearContentQueryParam(); if (onConfirm) { onConfirm(); }