Skip to content

Commit

Permalink
chore: fix shortcut space checks
Browse files Browse the repository at this point in the history
  • Loading branch information
boojack committed Feb 6, 2024
1 parent 4e73882 commit 435fe04
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions frontend/web/src/pages/ShortcutSpace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const ShortcutSpace = () => {
const currentUser = userStore.getCurrentUser();
const shortcutStore = useShortcutStore();
const [shortcut, setShortcut] = useState<Shortcut>();
const [loading, setLoading] = useState(true);
const [showCreateShortcutDrawer, setShowCreateShortcutDrawer] = useState(false);

useEffect(() => {
Expand All @@ -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");
Expand Down

0 comments on commit 435fe04

Please sign in to comment.