fix: fix slow loading times for nodeTypes, node creator vuex reference, and pushConnection in settings views (#4230)

This commit is contained in:
Alex Grozav
2022-09-29 16:06:40 +03:00
committed by GitHub
parent 3b7de6db72
commit d3c0d99867
6 changed files with 20 additions and 18 deletions

View File

@@ -393,11 +393,16 @@ export default mixins(
});
},
async initialize() {
await Promise.all([
const loadPromises = [
this.$store.dispatch('credentials/fetchAllCredentials'),
this.$store.dispatch('credentials/fetchCredentialTypes'),
this.$store.dispatch('nodeTypes/getNodeTypes'),
]);
];
if (this.$store.getters['nodeTypes/allNodeTypes'].length === 0) {
loadPromises.push(this.$store.dispatch('nodeTypes/getNodeTypes'));
}
await Promise.all(loadPromises);
this.loading = false;
this.$nextTick(this.focusSearchInput);