Fix navigation issue

This commit is contained in:
Leonardo Murça 2022-09-14 19:51:58 -03:00
parent df251c0de3
commit 0c35fb24e9
3 changed files with 4 additions and 4 deletions

View file

@ -10,7 +10,7 @@ import {
const avatarMenuOptions = (navigate, logout) => [ const avatarMenuOptions = (navigate, logout) => [
{ {
text: 'Meu Perfil', text: 'Meu Perfil',
action: () => navigate('/profile', { replace: true }), action: () => navigate('/profile'),
}, },
{ {
text: 'Sair', text: 'Sair',

View file

@ -51,7 +51,7 @@ function MainMenu({ options, layoutType }) {
onChange={(_, newValue) => { onChange={(_, newValue) => {
const newOption = options.find(option => option.id === newValue); const newOption = options.find(option => option.id === newValue);
setSelectedOption(newOption); setSelectedOption(newOption);
navigate(newOption.pathname, { replace: true }); navigate(newOption.pathname);
}} }}
sx={navigator} sx={navigator}
showLabels showLabels

View file

@ -30,11 +30,11 @@ function Home() {
}, [fetchAllAssignments]); }, [fetchAllAssignments]);
const onClickClassCard = id => { const onClickClassCard = id => {
navigate(`/class/${id}`, { replace: true }); navigate(`/class/${id}`);
}; };
const onClickAssignmentCard = id => { const onClickAssignmentCard = id => {
navigate(`/assignment/${id}`, { replace: true }); navigate(`/assignment/${id}`);
}; };
return ( return (