From 4b909b13fbb6d8d72ab38700b91cf18920d72fc4 Mon Sep 17 00:00:00 2001 From: kytwb Date: Sun, 19 Dec 2021 15:43:09 +0100 Subject: Hotfix for requireAuthenticatedUser error --- src/containers/layout/AppLayoutContainer.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/containers') diff --git a/src/containers/layout/AppLayoutContainer.js b/src/containers/layout/AppLayoutContainer.js index 536083c4f..c70144c8e 100644 --- a/src/containers/layout/AppLayoutContainer.js +++ b/src/containers/layout/AppLayoutContainer.js @@ -40,8 +40,18 @@ class AppLayoutContainer extends Component { requests, user, workspaces, + router } = this.props.stores; + /* HOTFIX for: + [mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: 'Reaction[bound ]' TypeError: Cannot read properties of null (reading 'push') + at RouterStore.push (store.js:25) + at UserStore._requireAuthenticatedUser + */ + if (!user.isLoggedIn) { + router.push('/auth/welcome'); + } + const { setActive, handleIPCMessage, -- cgit v1.2.3-54-g00ecf