Use mapGetters to simplify calls

This commit is contained in:
Iván Ovejero 2021-12-01 10:00:03 +01:00
parent 845b5e4d9b
commit 513ddbb383

View file

@ -243,6 +243,7 @@ export default mixins(
...mapGetters('ui', [ ...mapGetters('ui', [
'sidebarMenuCollapsed', 'sidebarMenuCollapsed',
]), ]),
...mapGetters(['nativelyNumberSuffixedDefaults']),
activeNode (): INodeUi | null { activeNode (): INodeUi | null {
return this.$store.getters.activeNode; return this.$store.getters.activeNode;
}, },
@ -1183,7 +1184,7 @@ export default mixins(
newNodeData.name = CanvasHelpers.getUniqueNodeName({ newNodeData.name = CanvasHelpers.getUniqueNodeName({
nodes: this.$store.getters.allNodes, nodes: this.$store.getters.allNodes,
originalName: newNodeData.name, originalName: newNodeData.name,
nativelyNumberSuffixed: this.$store.getters.nativelyNumberSuffixedDefaults, nativelyNumberSuffixed: this.nativelyNumberSuffixedDefaults,
}); });
if (nodeTypeData.webhooks && nodeTypeData.webhooks.length) { if (nodeTypeData.webhooks && nodeTypeData.webhooks.length) {
@ -1760,7 +1761,7 @@ export default mixins(
newNodeData.name = CanvasHelpers.getUniqueNodeName({ newNodeData.name = CanvasHelpers.getUniqueNodeName({
nodes: this.$store.getters.allNodes, nodes: this.$store.getters.allNodes,
originalName: newNodeData.name, originalName: newNodeData.name,
nativelyNumberSuffixed: this.$store.getters.nativelyNumberSuffixedDefaults, nativelyNumberSuffixed: this.nativelyNumberSuffixedDefaults,
}); });
newNodeData.position = CanvasHelpers.getNewNodePosition( newNodeData.position = CanvasHelpers.getNewNodePosition(
@ -2004,7 +2005,7 @@ export default mixins(
newName = CanvasHelpers.getUniqueNodeName({ newName = CanvasHelpers.getUniqueNodeName({
nodes: this.$store.getters.allNodes, nodes: this.$store.getters.allNodes,
originalName: newName, originalName: newName,
nativelyNumberSuffixed: this.$store.getters.nativelyNumberSuffixedDefaults, nativelyNumberSuffixed: this.nativelyNumberSuffixedDefaults,
}); });
// Rename the node and update the connections // Rename the node and update the connections
@ -2218,7 +2219,7 @@ export default mixins(
nodes: this.$store.getters.allNodes, nodes: this.$store.getters.allNodes,
originalName: node.name, originalName: node.name,
additionalUsedNames: newNodeNames, additionalUsedNames: newNodeNames,
nativelyNumberSuffixed: this.$store.getters.nativelyNumberSuffixedDefaults, nativelyNumberSuffixed: this.nativelyNumberSuffixedDefaults,
}); });
newNodeNames.push(newName); newNodeNames.push(newName);