Do not mount the command menu when the user is logged out (#8808)

Fixes two bugs:
- The command menu contains hooks which were trying to execute queries
even when the user was logged out
- The command menu could be opened with the command + K shortcut even
when the user was logged out
This commit is contained in:
Raphaël Bosi
2024-11-29 12:19:58 +01:00
committed by GitHub
parent c878f09d72
commit 05149feb00

View File

@ -88,19 +88,23 @@ export const DefaultLayout = () => {
`}
/>
<StyledLayout>
<ContextStoreComponentInstanceContext.Provider
value={{ instanceId: 'command-menu' }}
>
<ActionMenuComponentInstanceContext.Provider
value={{ instanceId: 'command-menu' }}
>
<RecordActionMenuEntriesSetter />
{isWorkflowEnabled && <RecordAgnosticActionsSetterEffect />}
<ActionMenuConfirmationModals />
<CommandMenu />
</ActionMenuComponentInstanceContext.Provider>
</ContextStoreComponentInstanceContext.Provider>
<KeyboardShortcutMenu />
{!showAuthModal && (
<>
<ContextStoreComponentInstanceContext.Provider
value={{ instanceId: 'command-menu' }}
>
<ActionMenuComponentInstanceContext.Provider
value={{ instanceId: 'command-menu' }}
>
<RecordActionMenuEntriesSetter />
{isWorkflowEnabled && <RecordAgnosticActionsSetterEffect />}
<ActionMenuConfirmationModals />
<CommandMenu />
</ActionMenuComponentInstanceContext.Provider>
</ContextStoreComponentInstanceContext.Provider>
<KeyboardShortcutMenu />
</>
)}
<StyledPageContainer
animate={{