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

@ -16,7 +16,7 @@ limitations under the License.
import { Room } from "matrix-js-sdk/src/models/room";
import { sleep } from "matrix-js-sdk/src/utils";
import { EventStatus } from "matrix-js-sdk/src/models/event";
import { EventStatus, MatrixEventEvent } from "matrix-js-sdk/src/models/event";
import React from "react";
import { MatrixClientPeg } from "../MatrixClientPeg";
@ -122,12 +122,12 @@ export async function leaveRoomBehaviour(roomId: string, retry = true, spinner =
}
if (!ev.status || ev.status === EventStatus.SENT) {
ev.off("Event.status", handler);
ev.off(MatrixEventEvent.Status, handler);
resolve();
}
};
ev.on("Event.status", handler);
ev.on(MatrixEventEvent.Status, handler);
})));
let results: { [roomId: string]: Error & { errcode?: string, message: string, data?: Record<string, any> } } = {};