Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit e9c2de4

Browse files
author
Kerry Archibald
committed
removelistener
Signed-off-by: Kerry Archibald <[email protected]>
1 parent 7fbecdc commit e9c2de4

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/stores/OwnBeaconStore.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export class OwnBeaconStore extends AsyncStoreWithClient<OwnBeaconStoreState> {
9393
protected async onNotReady() {
9494
this.matrixClient.removeListener(BeaconEvent.LivenessChange, this.onBeaconLiveness);
9595
this.matrixClient.removeListener(BeaconEvent.New, this.onNewBeacon);
96+
this.matrixClient.removeListener(RoomStateEvent.Members, this.onRoomStateMembers);
9697

9798
this.beacons.forEach(beacon => beacon.destroy());
9899

test/stores/OwnBeaconStore-test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ describe('OwnBeaconStore', () => {
251251

252252
expect(removeSpy.mock.calls[0]).toEqual(expect.arrayContaining([BeaconEvent.LivenessChange]));
253253
expect(removeSpy.mock.calls[1]).toEqual(expect.arrayContaining([BeaconEvent.New]));
254+
expect(removeSpy.mock.calls[2]).toEqual(expect.arrayContaining([RoomStateEvent.Members]));
254255
});
255256

256257
it('destroys beacons', async () => {

0 commit comments

Comments
 (0)