Unset room on active call when disconnecting
This commit is contained in:
parent
9f81699e01
commit
3d467a9491
2 changed files with 8 additions and 1 deletions
|
@ -210,7 +210,13 @@ impl ActiveCall {
|
|||
if room.as_ref() != self.room.as_ref().map(|room| &room.0) {
|
||||
if let Some(room) = room {
|
||||
let subscriptions = vec![
|
||||
cx.observe(&room, |_, _, cx| cx.notify()),
|
||||
cx.observe(&room, |this, room, cx| {
|
||||
if room.read(cx).status().is_offline() {
|
||||
this.set_room(None, cx);
|
||||
}
|
||||
|
||||
cx.notify();
|
||||
}),
|
||||
cx.subscribe(&room, |_, _, event, cx| cx.emit(event.clone())),
|
||||
];
|
||||
self.room = Some((room, subscriptions));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue