fix(dock): 面板去重(同侧+跨侧),修重复注册残留 v3.26.12
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 2m52s

This commit is contained in:
qiqi committed 2026-11-21 23:01:17 +08:00
1 parent d16f3434dd
commit 202f7b81de
13 files changed
+80 -32

No files matched your search

+10 -2
View File
@@ -129,7 +129,14 @@
if (first) { s.active = first; changed = true }
}
})
return changed ? next : d
// v3.26.12:同一面板同时出现在左右两侧 → 只保留左侧(老数据重复注册的残留)
const dup = next.left.list.filter(function (id) { return next.right.list.indexOf(id) >= 0 })
if (dup.length) {
next.right = Object.assign({}, next.right, { list: next.right.list.filter(function (id) { return dup.indexOf(id) < 0 }) })
if (dup.indexOf(next.right.active) >= 0) next.right.active = next.right.list[0] || ''
changed = true
}
return changed ? next : d
})
}, 1200)
return function () { clearTimeout(t) }
@@ -152,7 +159,8 @@
// 只有「用户手动拖出栏」的(记在 removed 里)不补,尊重手动排序/移除。
const removed = Array.isArray(s0.removed) ? s0.removed : []
const defList = (props.defaults && props.defaults[side] && props.defaults[side].list) || []
let list = (s0.list || []).filter(function (id) { return !!panels[id] })
// v3.26.12:老数据里可能存了重复面板 id(同一插件重复注册的历史残留)→ 去重
let list = (s0.list || []).filter(function (id) { return !!panels[id] }).filter(function (id, i, arr) { return arr.indexOf(id) === i })
for (const id of defList) {
if (!panels[id]) continue
if (removed.indexOf(id) >= 0) continue