From 113b47804fe53d53621ec866fc508d0598a2e6dc Mon Sep 17 00:00:00 2001 From: igorrCarvalho Date: Mon, 22 Apr 2024 22:23:47 -0300 Subject: [PATCH] Feat: Add validation to avoid error when user doesnt have access to the store --- src/frontend/src/modals/shareModal/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/modals/shareModal/index.tsx b/src/frontend/src/modals/shareModal/index.tsx index 2d23563f1..d40a5a399 100644 --- a/src/frontend/src/modals/shareModal/index.tsx +++ b/src/frontend/src/modals/shareModal/index.tsx @@ -43,8 +43,10 @@ export default function ShareModal({ disabled?: boolean; }): JSX.Element { function handleOpenWShortcut(e: KeyboardEvent) { - e.preventDefault() - internalSetOpen(state => !state); + if (hasApiKey || hasStore) { + e.preventDefault() + internalSetOpen(state => !state); + } } const version = useDarkStore((state) => state.version); const hasStore = useStoreStore((state) => state.hasStore);