Improve typing around event emitter handlers (#7816)
This commit is contained in:
parent
213b32bf14
commit
7fa01ffb06
79 changed files with 548 additions and 471 deletions
|
@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { MatrixClient } from "matrix-js-sdk/src/client";
|
||||
import { ClientEvent, MatrixClient } from "matrix-js-sdk/src/client";
|
||||
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
|
||||
|
||||
import { MatrixClientPeg } from '../../MatrixClientPeg';
|
||||
|
@ -46,10 +46,10 @@ export default class AccountSettingsHandler extends MatrixClientBackedSettingsHa
|
|||
|
||||
public initMatrixClient(oldClient: MatrixClient, newClient: MatrixClient) {
|
||||
if (oldClient) {
|
||||
oldClient.removeListener("accountData", this.onAccountData);
|
||||
oldClient.removeListener(ClientEvent.AccountData, this.onAccountData);
|
||||
}
|
||||
|
||||
newClient.on("accountData", this.onAccountData);
|
||||
newClient.on(ClientEvent.AccountData, this.onAccountData);
|
||||
}
|
||||
|
||||
private onAccountData = (event: MatrixEvent, prevEvent: MatrixEvent) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue