Make RPC client's current user_id observable

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
Nathan Sobo
2021-08-24 08:37:32 -06:00
co-authored by Antonio Scandurra
parent 9b636fb81e
commit 39ad7f6a60
2 changed files with 23 additions and 7 deletions
+7 -2
View File
@@ -206,7 +206,8 @@ impl Channel {
}
});
Ok(())
}.log_err()
}
.log_err()
})
.detach();
cx.notify();
@@ -222,7 +223,11 @@ impl Channel {
}
fn current_user_id(&self) -> Result<u64> {
self.rpc.user_id().ok_or_else(|| anyhow!("not logged in"))
self
.rpc
.user_id()
.borrow()
.ok_or_else(|| anyhow!("not logged in"))
}
fn handle_message_sent(