diff --git a/src/components/views/rooms/RoomKnocksBar.tsx b/src/components/views/rooms/RoomKnocksBar.tsx index 877e7a7c723..4928e3cf30c 100644 --- a/src/components/views/rooms/RoomKnocksBar.tsx +++ b/src/components/views/rooms/RoomKnocksBar.tsx @@ -33,7 +33,7 @@ export const RoomKnocksBar: VFC<{ room: Room }> = ({ room }) => { const [disabled, setDisabled] = useState(false); const knockMembers = useTypedEventEmitterState( room, - RoomStateEvent.Members, + RoomStateEvent.Update, useCallback(() => room.getMembersWithMembership("knock"), [room]), ); const knockMembersCount = knockMembers.length; diff --git a/src/components/views/settings/tabs/room/PeopleRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/PeopleRoomSettingsTab.tsx index 32411f54028..1febb2ca34c 100644 --- a/src/components/views/settings/tabs/room/PeopleRoomSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/PeopleRoomSettingsTab.tsx @@ -144,7 +144,7 @@ export const PeopleRoomSettingsTab: VFC<{ room: Room }> = ({ room }) => { const knockMembers = useTypedEventEmitterState( room, - RoomStateEvent.Members, + RoomStateEvent.Update, useCallback(() => room.getMembersWithMembership("knock"), [room]), ); diff --git a/test/components/views/rooms/RoomKnocksBar-test.tsx b/test/components/views/rooms/RoomKnocksBar-test.tsx index 6a323a6d2e5..30141077e81 100644 --- a/test/components/views/rooms/RoomKnocksBar-test.tsx +++ b/test/components/views/rooms/RoomKnocksBar-test.tsx @@ -141,7 +141,7 @@ describe("RoomKnocksBar", () => { expect(container.firstChild).toBeNull(); jest.spyOn(room, "getMembersWithMembership").mockReturnValue([bob]); act(() => { - room.emit(RoomStateEvent.Members, new MatrixEvent(), state, bob); + room.emit(RoomStateEvent.Update, state); }); expect(container.firstChild).not.toBeNull(); }); @@ -151,7 +151,7 @@ describe("RoomKnocksBar", () => { expect(screen.getByRole("heading")).toHaveTextContent("Asking to join"); jest.spyOn(room, "getMembersWithMembership").mockReturnValue([bob, jane]); act(() => { - room.emit(RoomStateEvent.Members, new MatrixEvent(), state, jane); + room.emit(RoomStateEvent.Update, state); }); expect(screen.getByRole("heading")).toHaveTextContent("2 people asking to join"); }); diff --git a/test/components/views/settings/tabs/room/PeopleRoomSettingsTab-test.tsx b/test/components/views/settings/tabs/room/PeopleRoomSettingsTab-test.tsx index 180b3609ea8..6c9051c0afc 100644 --- a/test/components/views/settings/tabs/room/PeopleRoomSettingsTab-test.tsx +++ b/test/components/views/settings/tabs/room/PeopleRoomSettingsTab-test.tsx @@ -176,7 +176,7 @@ describe("PeopleRoomSettingsTab", () => { jest.spyOn(room, "getMembersWithMembership").mockReturnValue([]); getComponent(room); act(() => { - room.emit(RoomStateEvent.Members, new MatrixEvent(), state, knockMember); + room.emit(RoomStateEvent.Update, state); }); expect(getParagraph()).toHaveTextContent("No requests"); }); @@ -209,7 +209,7 @@ describe("PeopleRoomSettingsTab", () => { jest.spyOn(room, "getMembersWithMembership").mockReturnValue([]); getComponent(room); act(() => { - room.emit(RoomStateEvent.Members, new MatrixEvent(), state, knockMember); + room.emit(RoomStateEvent.Update, state); }); expect(getParagraph()).toHaveTextContent("No requests"); });