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: clear shortcut filter when delete this shortcut (#611)

Wujiao233f982e83d0a55
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<ShortcutContainerProps> = (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);