When loggin in, send user id instead of creating a new watch channel

This commit is contained in:
Max Brunsfeld 2021-08-24 13:11:37 -07:00
parent bb570d3702
commit d9d52b8aa5

View File

@ -5,6 +5,7 @@ use gpui::{AsyncAppContext, Entity, ModelContext, Task};
use lazy_static::lazy_static;
use parking_lot::RwLock;
use postage::prelude::Stream;
use postage::sink::Sink;
use postage::watch;
use std::any::TypeId;
use std::collections::HashMap;
@ -225,7 +226,7 @@ impl Client {
.detach();
let mut state = self.state.write();
state.connection_id = Some(connection_id);
state.user_id = watch::channel_with(Some(user_id));
state.user_id.0.send(Some(user_id)).await?;
Ok(())
}