aboutsummaryrefslogtreecommitdiff
path: root/modern/src/App.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-01-15 17:37:20 -0800
committerAnton Tananaev <anton@traccar.org>2023-01-15 17:37:20 -0800
commit4290739f81aaed0a56fc5f575f558e5339b2ccf9 (patch)
treebf010481b6e6686c2a7ad8e3f287385bc17acff4 /modern/src/App.js
parent117ded36572449077da6176754f29ea510bec900 (diff)
downloadtrackermap-web-4290739f81aaed0a56fc5f575f558e5339b2ccf9.tar.gz
trackermap-web-4290739f81aaed0a56fc5f575f558e5339b2ccf9.tar.bz2
trackermap-web-4290739f81aaed0a56fc5f575f558e5339b2ccf9.zip
Remove default admin
Diffstat (limited to 'modern/src/App.js')
-rw-r--r--modern/src/App.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/modern/src/App.js b/modern/src/App.js
index e21cf1bf..62f0d749 100644
--- a/modern/src/App.js
+++ b/modern/src/App.js
@@ -27,6 +27,7 @@ const App = () => {
const desktop = useMediaQuery(theme.breakpoints.up('md'));
+ const newServer = useSelector((state) => state.session.server.newServer);
const initialized = useSelector((state) => !!state.session.user);
useEffectAsync(async () => {
@@ -34,6 +35,8 @@ const App = () => {
const response = await fetch('/api/session');
if (response.ok) {
dispatch(sessionActions.updateUser(await response.json()));
+ } else if (newServer) {
+ navigate('/register');
} else {
navigate('/login');
}