Fix erroneous auth check in CommandK
This commit is contained in:
parent
ef1c8fc79d
commit
39c924b3e0
@ -171,7 +171,7 @@ export default function CommandKClient({
|
|||||||
}],
|
}],
|
||||||
}];
|
}];
|
||||||
|
|
||||||
if (showDebugTools) {
|
if (isUserSignedIn && showDebugTools) {
|
||||||
clientSections.push({
|
clientSections.push({
|
||||||
heading: 'Debug Tools',
|
heading: 'Debug Tools',
|
||||||
accessory: <RiToolsFill size={16} className="translate-x-[-1px]" />,
|
accessory: <RiToolsFill size={16} className="translate-x-[-1px]" />,
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import {
|
|||||||
pathForTag,
|
pathForTag,
|
||||||
} from './paths';
|
} from './paths';
|
||||||
import { formatCameraText } from '@/camera';
|
import { formatCameraText } from '@/camera';
|
||||||
import { authCachedSafe } from '@/auth/cache';
|
|
||||||
import { photoQuantityText } from '@/photo';
|
import { photoQuantityText } from '@/photo';
|
||||||
import { formatCount, formatCountDescriptive } from '@/utility/string';
|
import { formatCount, formatCountDescriptive } from '@/utility/string';
|
||||||
import { sortTagsObject } from '@/tag';
|
import { sortTagsObject } from '@/tag';
|
||||||
@ -33,10 +32,6 @@ export default async function CommandK() {
|
|||||||
getUniqueFilmSimulationsCached().catch(() => []),
|
getUniqueFilmSimulationsCached().catch(() => []),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const session = await authCachedSafe();
|
|
||||||
|
|
||||||
const isAdminLoggedIn = Boolean(session?.user?.email);
|
|
||||||
|
|
||||||
const SECTION_TAGS: CommandKSection = {
|
const SECTION_TAGS: CommandKSection = {
|
||||||
heading: 'Tags',
|
heading: 'Tags',
|
||||||
accessory: <FaTag
|
accessory: <FaTag
|
||||||
@ -81,7 +76,7 @@ export default async function CommandK() {
|
|||||||
SECTION_CAMERAS,
|
SECTION_CAMERAS,
|
||||||
SECTION_FILM,
|
SECTION_FILM,
|
||||||
]}
|
]}
|
||||||
showDebugTools={isAdminLoggedIn && ADMIN_DEBUG_TOOLS_ENABLED}
|
showDebugTools={ADMIN_DEBUG_TOOLS_ENABLED}
|
||||||
footer={photoQuantityText(count, false)}
|
footer={photoQuantityText(count, false)}
|
||||||
/>;
|
/>;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user