From 6387b2d8f0ecfac7d4a36003b74d67b551e2ae09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Thu, 3 Dec 2020 10:21:03 +0100 Subject: [PATCH] fix: namespace settings in localStorage --- frontend/src/store/settings/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/store/settings/index.js b/frontend/src/store/settings/index.js index 898152d01e..d6a5077444 100644 --- a/frontend/src/store/settings/index.js +++ b/frontend/src/store/settings/index.js @@ -2,9 +2,12 @@ import { fromJS } from 'immutable'; import { UPDATE_SETTING } from './actions'; import { USER_LOGOUT, USER_LOGIN } from '../user/actions'; -// TODO: provde a mock if localstorage does not exists? -const localStorage = window.localStorage || {}; -const SETTINGS = 'settings'; +const localStorage = window.localStorage || { + setItem: () => {}, + getItem: () => {}, +}; +const basePath = location ? location.pathname : '/'; +const SETTINGS = `${basePath}:settings`; const DEFAULT = fromJS({});