1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix: namespace settings in localStorage

This commit is contained in:
Ivar Conradi Østhus 2020-12-03 10:21:03 +01:00
parent 9e9b2ffe6a
commit 6387b2d8f0

View File

@ -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({});