mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-20 22:07:15 +00:00
chore: fix shortcut space checks
This commit is contained in:
parent
4e73882bf1
commit
435fe04ab3
@ -17,6 +17,7 @@ const ShortcutSpace = () => {
|
|||||||
const currentUser = userStore.getCurrentUser();
|
const currentUser = userStore.getCurrentUser();
|
||||||
const shortcutStore = useShortcutStore();
|
const shortcutStore = useShortcutStore();
|
||||||
const [shortcut, setShortcut] = useState<Shortcut>();
|
const [shortcut, setShortcut] = useState<Shortcut>();
|
||||||
|
const [loading, setLoading] = useState(true);
|
||||||
const [showCreateShortcutDrawer, setShowCreateShortcutDrawer] = useState(false);
|
const [showCreateShortcutDrawer, setShowCreateShortcutDrawer] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -28,9 +29,14 @@ const ShortcutSpace = () => {
|
|||||||
console.error(error);
|
console.error(error);
|
||||||
toast.error(error.details);
|
toast.error(error.details);
|
||||||
}
|
}
|
||||||
|
setLoading(false);
|
||||||
})();
|
})();
|
||||||
}, [shortcutName]);
|
}, [shortcutName]);
|
||||||
|
|
||||||
|
if (loading) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (!shortcut) {
|
if (!shortcut) {
|
||||||
if (!currentUser) {
|
if (!currentUser) {
|
||||||
navigateTo("/404");
|
navigateTo("/404");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user