Get server integration tests passing again

* Set up UserStore to have the current user, so that
  channel messages can be sent. This is needed now that
  pending messages are represented more similarly to
  regular messages.
* Drop buffer inside of an `AppContext.update` block, so that
  the Buffer's release hook is called in time.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld
2021-09-15 16:17:07 -07:00
co-authored by Nathan Sobo
parent 95ef70e4f4
commit 31b5602dc1
5 changed files with 140 additions and 117 deletions
+6 -2
View File
@@ -111,8 +111,12 @@ impl UserStore {
.ok_or_else(|| anyhow!("server responded with no users"))
}
pub fn current_user(&self) -> &watch::Receiver<Option<Arc<User>>> {
&self.current_user
pub fn current_user(&self) -> Option<Arc<User>> {
self.current_user.borrow().clone()
}
pub fn watch_current_user(&self) -> watch::Receiver<Option<Arc<User>>> {
self.current_user.clone()
}
}