Skip to content

Commit

Permalink
Fix more router issues/prettify it (#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshithmohan authored Jul 25, 2022
1 parent b0fc74a commit 4aca4e3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/core/router/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ function Router(props: Props) {
<Route path="login" element={<LoginPage />} />
<Route path="error" element={<ErrorPage />} />
<Route path="firstrun" element={<FirstRunPage />}>
<Route index element={<Navigate to="acknowledgement" />} />
<Route index element={<Navigate to="acknowledgement" replace />} />
<Route path="acknowledgement" element={<Acknowledgement />} />
<Route path="db-setup" element={<DatabaseSetup />} />
<Route path="local-account" element={<LocalAccount />} />
<Route path="anidb-account" element={<AniDBAccount />} />
<Route path="community-sites" element={<MetadataSources />} />
<Route path="metadata-sources" element={<MetadataSources />} />
<Route path="start-server" element={<StartServer />} />
<Route path="import-folders" element={<ImportFolders />} />
<Route path="data-collection" element={<DataCollection />} />
Expand Down
4 changes: 2 additions & 2 deletions src/core/sagas/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function* login(action) {
}));

if ((payload.redirect) ?? true) {
yield put(push({ pathname: '/webui/dashboard' }));
yield put(push({ pathname: 'dashboard' }));
}
yield put(stopFetching('login'));
}
Expand All @@ -64,7 +64,7 @@ function* logout(action) {
if (payload && payload.clearState) {
yield put({ type: Events.STORE_CLEAR_STATE });
} else {
yield put(replace({ pathname: '/webui/login' }));
yield put(replace({ pathname: 'login' }));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/pages/firstrun/FirstRunPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function FirstRunPage() {

useEffect(() => {
if (status.State !== 4) {
dispatch(replace('/login'));
dispatch(replace('login'));
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/pages/login/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function LoginPage() {
}
};

const openFirstRunWizard = () => dispatch(push({ pathname: '/firstrun/acknowledgement' }));
const openFirstRunWizard = () => dispatch(push({ pathname: 'firstrun' }));

return (
<React.Fragment>
Expand Down

0 comments on commit 4aca4e3

Please sign in to comment.