Added homepage redirect when logout
This commit is contained in:
@@ -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()}`)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user