perf: update deepCopy (#4364)

* perf: update deepCopy

* fix: using deepCopy in core and cli packages

* fix: using deepCopy in editor

* chore: formatting

* fix: some micro optimisation in deepCopy
This commit is contained in:
Csaba Tuncsik
2022-10-18 13:33:31 +02:00
committed by GitHub
parent 638d6f60d3
commit 1aa21ed3df
14 changed files with 101 additions and 27 deletions

View File

@@ -192,6 +192,7 @@ import { WORKFLOW_SETTINGS_MODAL_KEY } from '../constants';
import mixins from 'vue-typed-mixins';
import { mapGetters } from "vuex";
import { deepCopy } from "n8n-workflow";
export default mixins(
externalHooks,
@@ -274,7 +275,7 @@ export default mixins(
this.$showError(error, 'Problem loading settings', 'The following error occurred loading the data:');
}
const workflowSettings = JSON.parse(JSON.stringify(this.$store.getters.workflowSettings));
const workflowSettings = deepCopy(this.$store.getters.workflowSettings);
if (workflowSettings.timezone === undefined) {
workflowSettings.timezone = 'DEFAULT';
@@ -536,7 +537,7 @@ export default mixins(
}
}
const oldSettings = JSON.parse(JSON.stringify(this.$store.getters.workflowSettings));
const oldSettings = deepCopy(this.$store.getters.workflowSettings);
this.$store.commit('setWorkflowSettings', localWorkflowSettings);