Skip to content

Commit

Permalink
fix(studio): don't allow same name in two nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
asashour committed Dec 4, 2019
1 parent 3a06e25 commit be48b7e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Expand Up @@ -10,7 +10,13 @@ const style = require('./style.scss')

export default class SkillCallNodePropertiesPanel extends Component {
renameNode = text => {
if (text && text !== this.props.node.name) {
if (text) {
let nodes = this.props.flow.nodes;
for (let i = 0; i < nodes.length; i++) {
if (text === nodes[i].name) {
return;
}
}
this.props.updateNode({ name: text })
}
}
Expand Down
Expand Up @@ -11,7 +11,13 @@ const style = require('./style.scss')

export default class StandardNodePropertiesPanel extends Component {
renameNode = text => {
if (text && text !== this.props.node.name) {
if (text) {
let nodes = this.props.flow.nodes;
for (let i = 0; i < nodes.length; i++) {
if (text === nodes[i].name) {
return;
}
}
this.props.updateNode({ name: text })
}
}
Expand Down

0 comments on commit be48b7e

Please sign in to comment.