From f982e83d0a55b7d18fa3fa69439a0766647f7aa1 Mon Sep 17 00:00:00 2001 From: Wujiao233 Date: Mon, 28 Nov 2022 06:14:25 +0800 Subject: [PATCH] fix: clear shortcut filter when delete this shortcut (#611) --- web/src/components/ShortcutList.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/src/components/ShortcutList.tsx b/web/src/components/ShortcutList.tsx index 18716180b..89c5d60a8 100644 --- a/web/src/components/ShortcutList.tsx +++ b/web/src/components/ShortcutList.tsx @@ -76,6 +76,10 @@ const ShortcutContainer: React.FC = (props: ShortcutCont if (showConfirmDeleteBtn) { try { await shortcutService.deleteShortcutById(shortcut.id); + if (locationService.getState().query?.shortcutId === shortcut.id) { + // need clear shortcut filter + locationService.setMemoShortcut(undefined); + } } catch (error: any) { console.error(error); toastHelper.error(error.response.data.message);