Skip to content

Commit

Permalink
Wipe update default password dialog on close
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-ubskii committed May 3, 2024
1 parent c19b190 commit bbd857b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions module/user/UpdateDefaultPasswordDialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,17 @@ object UpdateDefaultPasswordDialog {
var newPassword: String by mutableStateOf("")
var repeatPassword: String by mutableStateOf("")

override fun cancel() = Service.driver.updateDefaultPasswordDialog.cancel()
override fun submit() = Service.driver.updateDefaultPasswordDialog.submit(oldPassword, newPassword)
override fun cancel() {
Service.driver.updateDefaultPasswordDialog.cancel()
oldPassword = ""
newPassword = ""
}
override fun submit() {
assert(isValid())
Service.driver.updateDefaultPasswordDialog.submit(oldPassword, newPassword)
oldPassword = ""
newPassword = ""
}
override fun isValid() = oldPassword.isNotEmpty() && newPassword.isNotEmpty()
&& oldPassword != newPassword && repeatPassword == newPassword
}
Expand Down

0 comments on commit bbd857b

Please sign in to comment.