diff --git a/src/components/Settings/ItemSizeSelector.vue b/src/components/Settings/ItemSizeSelector.vue index 9143a465..9ba14906 100644 --- a/src/components/Settings/ItemSizeSelector.vue +++ b/src/components/Settings/ItemSizeSelector.vue @@ -37,8 +37,10 @@ export default { input: '', }; }, - props: { - iconSize: String, + computed: { + iconSize() { + return this.$store.getters.iconSize; + }, }, components: { IconSmall, diff --git a/src/components/Settings/LayoutSelector.vue b/src/components/Settings/LayoutSelector.vue index f4c624e5..fbb8c001 100644 --- a/src/components/Settings/LayoutSelector.vue +++ b/src/components/Settings/LayoutSelector.vue @@ -5,19 +5,19 @@ @@ -40,6 +40,11 @@ export default { IconHorizontal, IconVertical, }, + computed: { + layout() { + return this.$store.getters.layout; + }, + }, methods: { updateDisplayLayout(layout) { this.$store.commit(StoreKeys.SET_ITEM_LAYOUT, layout); diff --git a/src/components/Settings/SettingsContainer.vue b/src/components/Settings/SettingsContainer.vue index 01ebfdca..de4ed918 100644 --- a/src/components/Settings/SettingsContainer.vue +++ b/src/components/Settings/SettingsContainer.vue @@ -7,7 +7,7 @@
- + diff --git a/src/store.js b/src/store.js index 0fa33019..8041db10 100644 --- a/src/store.js +++ b/src/store.js @@ -145,10 +145,18 @@ const store = new Vuex.Store({ return foundSection; }, layout(state) { - return state.config.appConfig.layout || 'auto'; + const pageId = state.currentConfigInfo.confId; + const layoutStoreKey = pageId + ? `${localStorageKeys.LAYOUT_ORIENTATION}-${pageId}` : localStorageKeys.LAYOUT_ORIENTATION; + const appConfigLayout = state.config.appConfig.layout; + return localStorage.getItem(layoutStoreKey) || appConfigLayout || 'auto'; }, iconSize(state) { - return state.config.appConfig.iconSize || 'medium'; + const pageId = state.currentConfigInfo.confId; + const sizeStoreKey = pageId + ? `${localStorageKeys.ICON_SIZE}-${pageId}` : localStorageKeys.ICON_SIZE; + const appConfigSize = state.config.appConfig.iconSize; + return localStorage.getItem(sizeStoreKey) || appConfigSize || 'medium'; }, }, mutations: { @@ -310,11 +318,23 @@ const store = new Vuex.Store({ InfoHandler('Color palette updated', InfoKeys.VISUAL); }, [SET_ITEM_LAYOUT](state, layout) { - state.config.appConfig.layout = layout; + const newConfig = { ...state.config }; + newConfig.appConfig.layout = layout; + state.config = newConfig; + const pageId = state.currentConfigInfo.confId; + const layoutStoreKey = pageId + ? `${localStorageKeys.LAYOUT_ORIENTATION}-${pageId}` : localStorageKeys.LAYOUT_ORIENTATION; + localStorage.setItem(layoutStoreKey, layout); InfoHandler('Layout updated', InfoKeys.VISUAL); }, [SET_ITEM_SIZE](state, iconSize) { - state.config.appConfig.iconSize = iconSize; + const newConfig = { ...state.config }; + newConfig.appConfig.iconSize = iconSize; + state.config = newConfig; + const pageId = state.currentConfigInfo.confId; + const sizeStoreKey = pageId + ? `${localStorageKeys.ICON_SIZE}-${pageId}` : localStorageKeys.ICON_SIZE; + localStorage.setItem(sizeStoreKey, iconSize); InfoHandler('Item size updated', InfoKeys.VISUAL); }, [UPDATE_CUSTOM_CSS](state, customCss) { diff --git a/src/views/Home.vue b/src/views/Home.vue index b929e8b0..004b181a 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -19,14 +19,7 @@
-
+