mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
ensure that an incomplete pddb dict sigchat.account is deleted
This commit is contained in:
parent
3d5030f142
commit
89cdbc899e
1 changed files with 14 additions and 2 deletions
|
|
@ -226,10 +226,15 @@ impl<'a> SigChat<'a> {
|
|||
Ok(true) => {
|
||||
log::info!("Linked Signal Account");
|
||||
self.chat.set_busy_state(false);
|
||||
Ok(Account::read(SIGCHAT_ACCOUNT)?)
|
||||
}
|
||||
Ok(false) => {
|
||||
log::info!("failed to link Signal Account");
|
||||
self.chat.set_busy_state(false);
|
||||
Err(Error::new(
|
||||
ErrorKind::Other,
|
||||
"failed to link Signal Account",
|
||||
))
|
||||
}
|
||||
Err(e) => {
|
||||
log::warn!("error while linking Signal Account: {e}");
|
||||
|
|
@ -240,6 +245,10 @@ impl<'a> SigChat<'a> {
|
|||
self.modals
|
||||
.show_notification(&format!("{}", e), None)
|
||||
.expect("notification failed");
|
||||
Err(Error::new(
|
||||
ErrorKind::Other,
|
||||
"error while linking Signal Account",
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -251,9 +260,12 @@ impl<'a> SigChat<'a> {
|
|||
self.modals
|
||||
.show_notification(t!("sigchat.account.failed", locales::LANG), None)
|
||||
.expect("notification failed");
|
||||
Err(Error::new(
|
||||
ErrorKind::Other,
|
||||
"failed to create new Account in pddb",
|
||||
))
|
||||
}
|
||||
};
|
||||
Ok(Account::read(SIGCHAT_ACCOUNT)?)
|
||||
}
|
||||
}
|
||||
|
||||
/// Prompt a name from the user
|
||||
|
|
|
|||
Loading…
Reference in a new issue