Cache credentials in memory separately from connection status

This prevents us from re-prompting for keychain access when we retry connections after the connection is lost.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Nathan Sobo
2021-09-14 18:21:46 -06:00
co-authored by Max Brunsfeld
parent aa7c1bfa2d
commit 44a457e8b6
4 changed files with 138 additions and 116 deletions
+2 -2
View File
@@ -51,8 +51,8 @@ impl UserStore {
let mut status = rpc.status();
while let Some(status) = status.recv().await {
match status {
Status::Connected { user_id, .. } => {
if let Some(this) = this.upgrade() {
Status::Connected { .. } => {
if let Some((this, user_id)) = this.upgrade().zip(rpc.user_id()) {
current_user_tx
.send(this.fetch_user(user_id).log_err().await)
.await