Skip to content

Commit

Permalink
change password: prevent new password from being empty, release 2.0.2…
Browse files Browse the repository at this point in the history
… of the GUI
  • Loading branch information
emmanueltouzery committed Nov 22, 2020
1 parent c198e2c commit e18d143
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions flatpak/com.github.emmanueltouzery.projectpad.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ https://hughsie.github.io/oars/index.html
-->
<content_rating type="oars-1.0" />
<releases>
<release version="2.0.2" date="2020-11-22">
<description>
<ul>
<li>Prevent from changing the password to an empty password</li>
</ul>
</description>
</release>
<release version="2.0.1" date="2020-11-21">
<description>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion projectpad/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "projectpad"
version = "2.0.1"
version = "2.0.2"
authors = ["Emmanuel Touzery <[email protected]>"]
edition = "2018"

Expand Down
12 changes: 8 additions & 4 deletions projectpad/src/widgets/dialogs/change_db_password_dlg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,14 @@ impl Widget for ChangeDbPasswordDialog {
.emit(PasswordFieldMsg::RequestPassword);
}
Msg::GotNewPassword(pass) => {
self.model.new_password = Some(pass);
self.confirm_password_entry
.stream()
.emit(PasswordFieldMsg::RequestPassword);
if pass.is_empty() {
self.show_error("New password must not be empty");
} else {
self.model.new_password = Some(pass);
self.confirm_password_entry
.stream()
.emit(PasswordFieldMsg::RequestPassword);
}
}
Msg::GotConfirmNewPassword(pass) => {
if Some(&pass) != self.model.new_password.as_ref() {
Expand Down

0 comments on commit e18d143

Please sign in to comment.