Improve typing around event emitter handlers (#7816)

This commit is contained in:
Michael Telatynski 2022-02-22 12:18:08 +00:00 committed by GitHub
parent 213b32bf14
commit 7fa01ffb06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
79 changed files with 548 additions and 471 deletions

View file

@ -17,7 +17,7 @@ limitations under the License.
import { Room } from "matrix-js-sdk/src/models/room";
import { EventType } from "matrix-js-sdk/src/@types/event";
import { logger } from "matrix-js-sdk/src/logger";
import { MatrixClient } from "matrix-js-sdk/src/client";
import { ClientEvent, MatrixClient } from "matrix-js-sdk/src/client";
import { inviteUsersToRoom } from "../RoomInvite";
import Modal, { IHandle } from "../Modal";
@ -46,9 +46,9 @@ export async function awaitRoomDownSync(cli: MatrixClient, roomId: string): Prom
const checkForRoomFn = (room: Room) => {
if (room.roomId !== roomId) return;
resolve(room);
cli.off("Room", checkForRoomFn);
cli.off(ClientEvent.Room, checkForRoomFn);
};
cli.on("Room", checkForRoomFn);
cli.on(ClientEvent.Room, checkForRoomFn);
});
}