Create layout transitions

This commit is contained in:
Matthias 2022-12-04 13:35:05 +01:00
parent 221693c059
commit 5efa81c591

View File

@ -119,14 +119,24 @@ export const useLayoutStore = defineStore('layoutStore', {
persist: { persist: {
key: STORE_LAYOUTS, key: STORE_LAYOUTS,
afterRestore: (context) => { afterRestore: (context) => {
console.log('after restore - ', context.store);
if ( if (
context.store.dashboardLayout === null || context.store.dashboardLayout === null ||
typeof context.store.dashboardLayout === 'string' typeof context.store.dashboardLayout === 'string' ||
context.store.dashboardLayout.length === 0 ||
typeof context.store.dashboardLayout[0]['i'] === 'string' ||
context.store.dashboardLayout.length < DEFAULT_DASHBOARD_LAYOUT.length
) { ) {
console.log('loading dashboard Layout from default.');
context.store.dashboardLayout = JSON.parse(JSON.stringify(DEFAULT_DASHBOARD_LAYOUT)); context.store.dashboardLayout = JSON.parse(JSON.stringify(DEFAULT_DASHBOARD_LAYOUT));
} }
if (context.store.tradingLayout === null || typeof context.store.tradingLayout === 'string') { if (
context.store.tradingLayout === null ||
typeof context.store.tradingLayout === 'string' ||
context.store.tradingLayout.length === 0 ||
typeof context.store.tradingLayout[0]['i'] === 'string' ||
context.store.tradingLayout.length < DEFAULT_TRADING_LAYOUT.length
) {
console.log('loading trading Layout from default.');
context.store.tradingLayout = JSON.parse(JSON.stringify(DEFAULT_TRADING_LAYOUT)); context.store.tradingLayout = JSON.parse(JSON.stringify(DEFAULT_TRADING_LAYOUT));
} }
}, },