Added homepage redirect when logout

This commit is contained in:
FlorianSpeicher
2025-06-11 15:00:11 +02:00
parent 0e9dd03e56
commit d5f40da6ee

View File

@@ -69,6 +69,12 @@ export default function NavBar() {
setLoginOpen(true); setLoginOpen(true);
} else if (link === 'logout') { } else if (link === 'logout') {
logout(); logout();
if (
location.pathname.startsWith('/account') ||
location.pathname.startsWith('/orders')
) {
navigate('/');
}
} else { } else {
navigate(`/${link.toLowerCase()}`) navigate(`/${link.toLowerCase()}`)
} }