Overwrite config in update because otherwise deleted fields would be overwritten by the previous state

This commit is contained in:
chfhtw
2026-04-27 09:02:58 +02:00
parent 804716edb2
commit 98730ce612
2 changed files with 8 additions and 2 deletions
@@ -78,7 +78,10 @@ export default {
const section = this.sections.find(section => section.name == section_name);
for (var wid in section.widgets) {
if (section.widgets[wid].id == k) {
payload[k] = ObjectUtils.mergeDeep(section.widgets[wid], payload[k]);
const copy = ObjectUtils.mergeDeep(section.widgets[wid], payload[k]);
if (payload[k].config)
copy.config = payload[k].config;
payload[k] = copy;
// NOTE(chris): remove internal props
for (var prop of ['_x', '_y', '_w', '_h', 'index', 'id', 'custom'])
if (payload[k][prop])
+4 -1
View File
@@ -63,7 +63,10 @@ export default {
for (var k in payload) {
for (var wid in this.widgets) {
if (this.widgets[wid].id == k) {
payload[k] = ObjectUtils.mergeDeep(this.widgets[wid], payload[k]);
const copy = ObjectUtils.mergeDeep(this.widgets[wid], payload[k]);
if (payload[k].config)
copy.config = payload[k].config;
payload[k] = copy;
// NOTE(chris): remove internal props
for (var prop of ['_x', '_y', '_w', '_h', 'index', 'id', 'preset'])
if (payload[k][prop])