Don't initialize KBar when unauthed (#6328)

* Don't initialize KBar when unauthed

* Don't render trigger when query is undefined
pull/6327/head^2
Alex van Andel 2023-01-07 22:31:15 +00:00 committed by GitHub
parent d95bba63f4
commit e5f0452728
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -273,7 +273,7 @@ export const KBarContent = () => {
export const KBarTrigger = () => {
const { query } = useKBar();
return (
return query ? (
<>
<Tooltip side="right" content={isMac ? "⌘ + K" : "CTRL + K"}>
<button
@ -284,7 +284,7 @@ export const KBarTrigger = () => {
</button>
</Tooltip>
</>
);
) : null;
};
const DisplayShortcuts = (item: shortcutArrayType) => {

View File

@ -195,8 +195,13 @@ export default function Shell(props: LayoutProps) {
useRedirectToLoginIfUnauthenticated(props.isPublic);
useRedirectToOnboardingIfNeeded();
useTheme("light");
return (
// don't load KBar when unauthed
return props.isPublic ? (
<>
<CustomBrandingContainer />
<Layout {...props} />
</>
) : (
<KBarRoot>
<CustomBrandingContainer />
<Layout {...props} />