mirror of
https://github.com/45Drives/cockpit-navigator.git
synced 2025-09-26 03:08:41 +02:00
use assignObjectRecursive
This commit is contained in:
parent
f8c4806aa5
commit
973ac41c9c
@ -149,6 +149,7 @@ import LabelledSwitch from './LabelledSwitch.vue';
|
|||||||
import ModalPopup from './ModalPopup.vue';
|
import ModalPopup from './ModalPopup.vue';
|
||||||
import { AdjustmentsIcon, ChevronRightIcon, ChevronLeftIcon } from '@heroicons/vue/solid';
|
import { AdjustmentsIcon, ChevronRightIcon, ChevronLeftIcon } from '@heroicons/vue/solid';
|
||||||
import { settingsInjectionKey } from '../keys';
|
import { settingsInjectionKey } from '../keys';
|
||||||
|
import assignObjectRecursive from '../functions/assignObjectRecursive';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {NavigatorSettings}
|
* @type {NavigatorSettings}
|
||||||
@ -196,19 +197,7 @@ export default {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const storedSettings = JSON.parse(localStorage.getItem(settingsStorageKey)) ?? {};
|
assignObjectRecursive(settings, JSON.parse(localStorage.getItem(settingsStorageKey)) ?? {}, defaultSettings);
|
||||||
Object.assign(settings, {
|
|
||||||
...defaultSettings,
|
|
||||||
...storedSettings,
|
|
||||||
directoryView: {
|
|
||||||
...defaultSettings.directoryView,
|
|
||||||
...(storedSettings.directoryView ?? {}),
|
|
||||||
cols: {
|
|
||||||
...defaultSettings.directoryView.cols,
|
|
||||||
...(storedSettings.directoryView?.cols ?? {}),
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
watch(settings, () => {
|
watch(settings, () => {
|
||||||
localStorage.setItem(settingsStorageKey, JSON.stringify(settings));
|
localStorage.setItem(settingsStorageKey, JSON.stringify(settings));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user