Fix small nagivation bugs

This commit is contained in:
Leonardo Murça 2022-06-21 08:58:36 -03:00
parent ff8c8073db
commit 5c78405bf2
2 changed files with 8 additions and 1 deletions

View file

@ -60,6 +60,7 @@ function AuthenticatedApp() {
<Route path="/info" element={<Information />} /> <Route path="/info" element={<Information />} />
<Route path="/calendar" element={<Calendar />} /> <Route path="/calendar" element={<Calendar />} />
<Route path="/login" element={<Navigate to="/home" />} /> <Route path="/login" element={<Navigate to="/home" />} />
<Route path="/" element={<Navigate to="/home" />} />
</Routes> </Routes>
</Container> </Container>
</> </>

View file

@ -57,7 +57,13 @@ function UserProvider(props) {
const classrooms = () => { const classrooms = () => {
setState({ ...state, status: 'pending' }); setState({ ...state, status: 'pending' });
getClassrooms(user.id).then(data => getClassrooms(user.id).then(data =>
setState({ status: 'success', user, classrooms: data.data, error: null }) setState({
status: 'success',
user,
classrooms: data.data,
error: null,
pathname,
})
); );
}; };