From 3e2ed0b42cb87b6e93f7fd0e26813d5c1b9c44e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Wed, 5 May 2021 10:57:07 +0200 Subject: [PATCH] fix: use correct baseUriPath with localStorage --- frontend/src/store/settings/index.js | 4 +++- frontend/src/store/ui-config/index.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/store/settings/index.js b/frontend/src/store/settings/index.js index 52a1d01644..a59ef68cbb 100644 --- a/frontend/src/store/settings/index.js +++ b/frontend/src/store/settings/index.js @@ -2,11 +2,13 @@ import { fromJS } from 'immutable'; import { UPDATE_SETTING } from './actions'; import { USER_LOGOUT, USER_LOGIN } from '../user/actions'; +import { getBasePath } from '../../utils/format-path'; + const localStorage = window.localStorage || { setItem: () => {}, getItem: () => {}, }; -const basePath = location ? location.pathname : '/'; +const basePath =  getBasePath(); const SETTINGS = `${basePath}:settings`; const DEFAULT = fromJS({ location: {} }); diff --git a/frontend/src/store/ui-config/index.js b/frontend/src/store/ui-config/index.js index 4852de5628..1aa3f6e4ce 100644 --- a/frontend/src/store/ui-config/index.js +++ b/frontend/src/store/ui-config/index.js @@ -1,12 +1,14 @@ import { Map as $Map } from 'immutable'; import { RECEIVE_CONFIG } from './actions'; +import { getBasePath } from '../../utils/format-path'; + const localStorage = window.localStorage || { setItem: () => {}, getItem: () => {}, }; -const basePath = location ? location.pathname : '/'; +const basePath =  getBasePath(); const UI_CONFIG = `${basePath}:ui_config`; const DEFAULT = new $Map({