From a97c07bfdfd8b69d59fec619d269cf14d65d8e0c Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 17 Mar 2022 09:02:26 +0200 Subject: [PATCH] fix settings not persisting --- src/lib/persisted_state.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/persisted_state.js b/src/lib/persisted_state.js index 8ecb66a8c8..24b835da55 100644 --- a/src/lib/persisted_state.js +++ b/src/lib/persisted_state.js @@ -1,6 +1,6 @@ import merge from 'lodash.merge' import localforage from 'localforage' -import { each, get, set } from 'lodash' +import { each, get, set, cloneDeep } from 'lodash' let loaded = false @@ -69,7 +69,7 @@ export default function createPersistedState ({ subscriber(store)((mutation, state) => { try { if (saveImmedeatelyActions.includes(mutation.type)) { - setState(key, reducer(state, paths), storage) + setState(key, reducer(cloneDeep(state), paths), storage) .then(success => { if (typeof success !== 'undefined') { if (mutation.type === 'setOption' || mutation.type === 'setCurrentUser') {