Expand left sidebar on home module entry

This commit is contained in:
鲨鱼辣椒 committed 2026-10-14 11:14:43 +08:00
1 parent b7f50be87b
commit 1c39471156
4 files changed
+88 -2

No files matched your search

+3
View File
@@ -12,6 +12,7 @@ import { aiModules, isAiModuleAllowed, type AiModuleId } from '@/lib/ai-modules'
import { getAuthUserDisplayName } from '@/lib/auth-user-display';
import { cn } from '@/lib/utils';
import { useAuthStore } from '@/stores/auth';
import { useSettingsStore } from '@/stores/settings';
import { getUserProfileDisplayName } from '@/stores/user-profile';
const moduleSelectionContent: Record<AiModuleId, { label: string; image: string; imageAlt: string }> = {
@@ -23,6 +24,7 @@ const moduleSelectionContent: Record<AiModuleId, { label: string; image: string;
export function ModuleSelection({ authRequired = true }: { authRequired?: boolean }) {
const navigate = useNavigate();
const setSidebarCollapsed = useSettingsStore((state) => state.setSidebarCollapsed);
const authUser = useAuthStore((state) => state.user);
const moduleAccess = useAuthStore((state) => state.moduleAccess);
const authenticated = useAuthStore((state) => state.isAuthenticated());
@@ -46,6 +48,7 @@ export function ModuleSelection({ authRequired = true }: { authRequired?: boolea
navigate('/login');
return;
}
if (useSettingsStore.getState().sidebarCollapsed) setSidebarCollapsed(false);
navigate(route === '/cloud-agents' ? `${route}?view=mine` : route);
};