fix: omitted keys are ignored during merging (#501)

This commit is contained in:
Lykin
2025-11-21 11:06:04 +08:00
parent 10cb916faa
commit 551c4d3db4

View File

@@ -1,5 +1,5 @@
import { defineStore } from 'pinia'
import { get, isEmpty, isObject, uniq } from 'lodash'
import { get, isEmpty, isObject, union, uniq } from 'lodash'
import {
CreateGroup,
DeleteConnection,
@@ -210,7 +210,8 @@ const useConnectionStore = defineStore('connections', {
mergeConnectionProfile(dest, src) {
const mergeObj = (destObj, srcObj) => {
for (const k in srcObj) {
const keys = union(Object.keys(destObj), Object.keys(srcObj))
for (const k of keys) {
const t = typeof srcObj[k]
if (t === 'string') {
destObj[k] = srcObj[k] || destObj[k] || ''