From 8fffce8a303c764ce61a968109e0c5ddb70024d7 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 19 Aug 2020 19:42:36 -0600 Subject: [PATCH] Appease the linter --- src/utils/membership.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/utils/membership.ts b/src/utils/membership.ts index 2693d816a5..14a3ced739 100644 --- a/src/utils/membership.ts +++ b/src/utils/membership.ts @@ -108,11 +108,12 @@ export async function leaveRoomBehaviour(roomId: string) { const errors = Object.entries(results).filter(r => !!r[1]); if (errors.length > 0) { - let messages = []; - for (const err of errors) { + const messages = []; + for (const roomErr of errors) { + const err = roomErr[1]; // [0] is the roomId let message = _t("Unexpected server error trying to leave the room"); - if (results[roomId].errcode && results[roomId].message) { - if (results[roomId].errcode === 'M_CANNOT_LEAVE_SERVER_NOTICE_ROOM') { + if (err.errcode && err.message) { + if (err.errcode === 'M_CANNOT_LEAVE_SERVER_NOTICE_ROOM') { Modal.createTrackedDialog('Error Leaving Room', '', ErrorDialog, { title: _t("Can't leave Server Notices room"), description: _t(