Skip to content

Commit

Permalink
fix: Remove bug when error doesn't appear after inserting empty value…
Browse files Browse the repository at this point in the history
… twice
  • Loading branch information
nemakin committed May 2, 2023
1 parent f375a23 commit 70ed4fd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions app/src/main/kotlin/app/view/treeView/AVLTreeView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ class AVLTreeView : View() {
} else {
alert(type = Alert.AlertType.ERROR, header = "Insertion Error")
}
key.value = ""
value.value = ""
key.value = null
value.value = null
}
}
field("Key") {
Expand All @@ -123,7 +123,6 @@ class AVLTreeView : View() {
button("Save tree") {
action {
if (tree.getRoot() != null) {
// tree.treeName = treeName.value
controller.saveTree(tree, treeName.value)
if (!availableTrees.items.contains(treeName.value)) {
availableTrees.items.add(treeName.value)
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/kotlin/app/view/treeView/BinarySearchTreeView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ class BinarySearchTreeView : View() {
} else {
alert(type = Alert.AlertType.ERROR, header = "Insertion Error")
}
key.value = ""
value.value = ""
key.value = null
value.value = null
}
}
field("Key") {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/kotlin/app/view/treeView/RedBlackTreeView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ class RedBlackTreeView : View() {
} else {
alert(type = Alert.AlertType.ERROR, header = "Insertion Error")
}
key.value = ""
value.value = ""
key.value = null
value.value = null
}
}
field("Value") {
Expand Down

0 comments on commit 70ed4fd

Please sign in to comment.