Better pw prompting
This commit is contained in:
parent
4f5d1c46d3
commit
4e0e08f3f0
1 changed files with 8 additions and 2 deletions
|
@ -92,14 +92,20 @@ fn main() {
|
|||
let pw = window().prompt_with_message("A password is required to decrypt this paste:");
|
||||
|
||||
match pw {
|
||||
// Ok button was entered.
|
||||
Ok(Some(password)) if !password.is_empty() => {
|
||||
break Some(SecretVec::new(password.into_bytes()));
|
||||
}
|
||||
Err(_) => {
|
||||
// Cancel button was entered.
|
||||
Ok(None) => {
|
||||
render_message("This paste requires a password.".into());
|
||||
return;
|
||||
}
|
||||
_ => (),
|
||||
e => {
|
||||
render_message("Internal error occurred.".into());
|
||||
error!(format!("Error occurred at pw prompt: {:?}", e));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue