collab ui: Dismiss project shared notifications when leaving room (#10160)
When leaving a call/room in which a project was shared, the shared project notification was not getting dismissed when the person that shared the project left the room. Although there was a `cx.emit(Event::Left)` call inside room, the event was never received in the `project_shared_notification` module, because the room is dropped before the event can be dispatched. Moving the `cx.emit(Event::Left)` to the active call fixed the problem. Also renamed `Event::Left` to `Event::RoomLeft` because the room join equivalent is also called `Event::RoomJoined`. Release Notes: - Fixed project shared notification staying open, when the user that shared the project left the room
This commit is contained in:
parent
8e9543aefe
commit
5b4ff74dca
5 changed files with 24 additions and 6 deletions
|
@ -1866,6 +1866,24 @@ async fn test_active_call_events(
|
|||
executor.run_until_parked();
|
||||
assert_eq!(mem::take(&mut *events_a.borrow_mut()), vec![]);
|
||||
assert_eq!(mem::take(&mut *events_b.borrow_mut()), vec![]);
|
||||
|
||||
// Unsharing a project should dispatch the RemoteProjectUnshared event.
|
||||
active_call_a
|
||||
.update(cx_a, |call, cx| call.hang_up(cx))
|
||||
.await
|
||||
.unwrap();
|
||||
executor.run_until_parked();
|
||||
|
||||
assert_eq!(
|
||||
mem::take(&mut *events_a.borrow_mut()),
|
||||
vec![room::Event::RoomLeft { channel_id: None }]
|
||||
);
|
||||
assert_eq!(
|
||||
mem::take(&mut *events_b.borrow_mut()),
|
||||
vec![room::Event::RemoteProjectUnshared {
|
||||
project_id: project_a_id,
|
||||
}]
|
||||
);
|
||||
}
|
||||
|
||||
fn active_call_events(cx: &mut TestAppContext) -> Rc<RefCell<Vec<room::Event>>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue