You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
Fix a crash when a call ends while you're in it (#10681)
This commit is contained in:
@ -773,6 +773,7 @@ export class ElementCall extends Call {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public destroy(): void {
|
public destroy(): void {
|
||||||
|
ActiveWidgetStore.instance.destroyPersistentWidget(this.widget.id, this.groupCall.room.roomId);
|
||||||
WidgetStore.instance.removeVirtualWidget(this.widget.id, this.groupCall.room.roomId);
|
WidgetStore.instance.removeVirtualWidget(this.widget.id, this.groupCall.room.roomId);
|
||||||
this.off(CallEvent.Participants, this.onParticipants);
|
this.off(CallEvent.Participants, this.onParticipants);
|
||||||
this.groupCall.off(GroupCallEvent.ParticipantsChanged, this.onGroupCallParticipants);
|
this.groupCall.off(GroupCallEvent.ParticipantsChanged, this.onGroupCallParticipants);
|
||||||
|
@ -1050,6 +1050,12 @@ describe("ElementCall", () => {
|
|||||||
|
|
||||||
call.off(CallEvent.Destroy, onDestroy);
|
call.off(CallEvent.Destroy, onDestroy);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("clears widget persistence when destroyed", async () => {
|
||||||
|
const destroyPersistentWidgetSpy = jest.spyOn(ActiveWidgetStore.instance, "destroyPersistentWidget");
|
||||||
|
call.destroy();
|
||||||
|
expect(destroyPersistentWidgetSpy).toHaveBeenCalled();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("instance in a video room", () => {
|
describe("instance in a video room", () => {
|
||||||
|
Reference in New Issue
Block a user