Fix erroneous auth check in CommandK

This commit is contained in:
Sam Becker 2024-04-21 22:46:07 -05:00
parent ef1c8fc79d
commit 39c924b3e0
2 changed files with 2 additions and 7 deletions

View File

@ -171,7 +171,7 @@ export default function CommandKClient({
}],
}];
if (showDebugTools) {
if (isUserSignedIn && showDebugTools) {
clientSections.push({
heading: 'Debug Tools',
accessory: <RiToolsFill size={16} className="translate-x-[-1px]" />,

View File

@ -11,7 +11,6 @@ import {
pathForTag,
} from './paths';
import { formatCameraText } from '@/camera';
import { authCachedSafe } from '@/auth/cache';
import { photoQuantityText } from '@/photo';
import { formatCount, formatCountDescriptive } from '@/utility/string';
import { sortTagsObject } from '@/tag';
@ -33,10 +32,6 @@ export default async function CommandK() {
getUniqueFilmSimulationsCached().catch(() => []),
]);
const session = await authCachedSafe();
const isAdminLoggedIn = Boolean(session?.user?.email);
const SECTION_TAGS: CommandKSection = {
heading: 'Tags',
accessory: <FaTag
@ -81,7 +76,7 @@ export default async function CommandK() {
SECTION_CAMERAS,
SECTION_FILM,
]}
showDebugTools={isAdminLoggedIn && ADMIN_DEBUG_TOOLS_ENABLED}
showDebugTools={ADMIN_DEBUG_TOOLS_ENABLED}
footer={photoQuantityText(count, false)}
/>;
}