Skip to content

Commit

Permalink
fix: broken state merging (cont.)
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
  • Loading branch information
pedrolamas committed Apr 10, 2024
1 parent c99b7f3 commit 6ad2aca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/store/config/mutations.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Vue, { reactive } from 'vue'
import Vue from 'vue'
import type { MutationTree } from 'vuex'
import type { ConfigState, UiSettings, SaveByPath, InstanceConfig, InitConfig } from './types'
import { defaultState } from './state'
import { Globals } from '@/globals'
import { mergeWith, set } from 'lodash-es'
import { cloneDeep, mergeWith, set } from 'lodash-es'
import { v4 as uuidv4 } from 'uuid'
import type { AppTableHeader } from '@/types'
import type { AppTablePartialHeader } from '@/types/tableheaders'
Expand Down Expand Up @@ -48,12 +48,12 @@ export const mutations: MutationTree<ConfigState> = {
}

const mergedSettings = mergeWith(
state.uiSettings,
cloneDeep(state.uiSettings),
payload,
(dest, src) => Array.isArray(dest) ? src : undefined
)

Vue.set(state, 'uiSettings', reactive(mergedSettings))
Vue.set(state, 'uiSettings', mergedSettings)
}
},

Expand Down

0 comments on commit 6ad2aca

Please sign in to comment.