From 435fe04ab31b114efab70f79a6296d8e6b412870 Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 6 Feb 2024 21:15:58 +0800 Subject: [PATCH] chore: fix shortcut space checks --- frontend/web/src/pages/ShortcutSpace.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/web/src/pages/ShortcutSpace.tsx b/frontend/web/src/pages/ShortcutSpace.tsx index 1ff4621d..030b660b 100644 --- a/frontend/web/src/pages/ShortcutSpace.tsx +++ b/frontend/web/src/pages/ShortcutSpace.tsx @@ -17,6 +17,7 @@ const ShortcutSpace = () => { const currentUser = userStore.getCurrentUser(); const shortcutStore = useShortcutStore(); const [shortcut, setShortcut] = useState(); + const [loading, setLoading] = useState(true); const [showCreateShortcutDrawer, setShowCreateShortcutDrawer] = useState(false); useEffect(() => { @@ -28,9 +29,14 @@ const ShortcutSpace = () => { console.error(error); toast.error(error.details); } + setLoading(false); })(); }, [shortcutName]); + if (loading) { + return null; + } + if (!shortcut) { if (!currentUser) { navigateTo("/404");