flora is a fast and secure runtime that lets you write discord bots for your servers, with a rich TypeScript SDK, without worrying about running infrastructure. [mirror]
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(frontend): route logout action to login page

Session-Id: 97fac837-2eda-4766-9d59-31b72205a23e

+8 -4
+8 -4
apps/frontend/src/components/sidebar/app-sidebar.tsx
··· 11 11 } from '@/components/ui/sidebar' 12 12 import { Skeleton } from '@/components/ui/skeleton' 13 13 import { useApp } from '@/contexts/AppContext' 14 - import { useLoginRedirect } from '@/hooks/use-login-redirect' 15 14 import { cn } from '@/lib/utils' 16 15 import { domAnimation, LazyMotion, m, useReducedMotion } from 'framer-motion' 17 16 import { BookText, FileCode2, ListChecks, Shield } from 'lucide-react' ··· 31 30 export function DashboardSidebar() { 32 31 const { state, isMobile, setOpenMobile } = useSidebar() 33 32 const isCollapsed = state === 'collapsed' 34 - const { session, guilds, selectedGuild, setSelectedGuild, view, setView } = useApp() 33 + const { session, guilds, selectedGuild, setSelectedGuild, setSession, view, setView } = useApp() 35 34 const [, setLocation] = useLocation() 36 - const redirectToLogin = useLoginRedirect() 37 35 const prefersReducedMotion = useReducedMotion() 38 36 39 37 const handleGuildClick = (guildId: string) => { 40 38 setSelectedGuild(guildId) 41 39 setView('guild') 40 + if (isMobile) setOpenMobile(false) 41 + } 42 + 43 + const handleLogoutClick = () => { 44 + setSession(null) 45 + setLocation('/login') 42 46 if (isMobile) setOpenMobile(false) 43 47 } 44 48 ··· 150 154 <NavUser 151 155 user={session} 152 156 onSettingsClick={() => setView('user-settings')} 153 - onLogoutClick={redirectToLogin} 157 + onLogoutClick={handleLogoutClick} 154 158 /> 155 159 )} 156 160 </SidebarFooter>