mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
Overwrite config in update because otherwise deleted fields would be overwritten by the previous state
This commit is contained in:
@@ -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])
|
||||
|
||||
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user