Avoid self = this

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-09-22 08:11:26 +02:00
parent 7f8c0e99ea
commit 8bbaf642bf
No known key found for this signature in database
GPG key ID: 55C211A1226CB17D

View file

@ -173,8 +173,6 @@ export default class SecurityUserSettingsTab extends React.Component<IProps, ISt
}); });
// Execute all acceptances/rejections sequentially // Execute all acceptances/rejections sequentially
// eslint-disable-next-line @typescript-eslint/no-this-alias
const self = this;
const cli = MatrixClientPeg.get(); const cli = MatrixClientPeg.get();
const action = accept ? cli.joinRoom.bind(cli) : cli.leave.bind(cli); const action = accept ? cli.joinRoom.bind(cli) : cli.leave.bind(cli);
for (let i = 0; i < invitedRoomIds.length; i++) { for (let i = 0; i < invitedRoomIds.length; i++) {
@ -183,7 +181,7 @@ export default class SecurityUserSettingsTab extends React.Component<IProps, ISt
// Accept/reject invite // Accept/reject invite
await action(roomId).then(() => { await action(roomId).then(() => {
// No error, update invited rooms button // No error, update invited rooms button
this.setState({ invitedRoomAmt: self.state.invitedRoomAmt - 1 }); this.setState({ invitedRoomAmt: this.state.invitedRoomAmt - 1 });
}, async (e) => { }, async (e) => {
// Action failure // Action failure
if (e.errcode === "M_LIMIT_EXCEEDED") { if (e.errcode === "M_LIMIT_EXCEEDED") {