Skip to content

Commit

Permalink
Merge pull request #357 from benderl/bugfix
Browse files Browse the repository at this point in the history
deepcopy default configurations
  • Loading branch information
benderl authored Oct 12, 2023
2 parents f91ce0c + a7ddbf7 commit f410424
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/views/DataManagement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,9 @@ export default {
"defaults"
)
) {
return { ...backupCloudDefaults.defaults };
return {
...JSON.parse(JSON.stringify(backupCloudDefaults.defaults)),
};
}
console.warn(
"no default configuration found for backup cloud type!",
Expand Down
6 changes: 5 additions & 1 deletion src/views/GeneralConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,11 @@ export default {
"defaults"
)
) {
return { ...webThemeDefaults.defaults.configuration };
return {
...JSON.parse(
JSON.stringify(webThemeDefaults.defaults.configuration)
),
};
}
console.warn(
"no default configuration found for web theme type!",
Expand Down
8 changes: 7 additions & 1 deletion src/views/OptionalComponents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,13 @@ export default {
"defaults"
)
) {
return { ...displayThemeDefaults.defaults.configuration };
return {
...JSON.parse(
JSON.stringify(
displayThemeDefaults.defaults.configuration
)
),
};
}
console.warn(
"no default configuration found for display theme type!",
Expand Down
2 changes: 1 addition & 1 deletion src/views/VehicleConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2279,7 +2279,7 @@ export default {
(element) => element.value == socType
);
if (Object.prototype.hasOwnProperty.call(socDefaults, "defaults")) {
return { ...socDefaults.defaults };
return { ...JSON.parse(JSON.stringify(socDefaults.defaults)) };
}
console.warn(
"no default configuration found for soc type!",
Expand Down

0 comments on commit f410424

Please sign in to comment.