From 4fd48988e96683df1dd3c543c700bc1afd0166a2 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 22 Mar 2019 17:39:42 -0600 Subject: [PATCH] Check for any errors leaving the room, not just the top level --- src/components/structures/MatrixChat.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 17ce6e0e73..26956858be 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -1067,10 +1067,11 @@ export default React.createClass({ d.then((errors) => { modal.close(); - if (errors[roomId]) { - // Something went wrong - const err = errors[roomId]; - console.error("Failed to leave room " + roomId + " " + err); + for (const leftRoomId of Object.keys(errors)) { + const err = errors[leftRoomId]; + if (!err) continue; + + console.error("Failed to leave room " + leftRoomId + " " + err); let title = _t("Failed to leave room"); let message = _t("Server may be unavailable, overloaded, or you hit a bug."); if (err.errcode === 'M_CANNOT_LEAVE_SERVER_NOTICE_ROOM') {