Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 2b027b7

Browse files
committed
Suppress CORS errors in the 'failed to join room' dialog
This isn't pretty, but it does address element-hq/element-web#7526 Tested with Chrome and Firefox to ensure the message is stable enough to parse.
1 parent 0c6e985 commit 2b027b7

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/i18n/strings/en_EN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@
220220
"Your browser does not support the required cryptography extensions": "Your browser does not support the required cryptography extensions",
221221
"Not a valid Riot keyfile": "Not a valid Riot keyfile",
222222
"Authentication check failed: incorrect password?": "Authentication check failed: incorrect password?",
223+
"There was an error joining the room": "There was an error joining the room",
223224
"Sorry, your homeserver is too old to participate in this room.": "Sorry, your homeserver is too old to participate in this room.",
224225
"Please contact your homeserver administrator.": "Please contact your homeserver administrator.",
225226
"Failed to join room": "Failed to join room",

src/stores/RoomViewStore.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ class RoomViewStore extends Store {
224224
err: err,
225225
});
226226
let msg = err.message ? err.message : JSON.stringify(err);
227+
if (msg && msg.startsWith("CORS request rejected")) {
228+
msg = _t("There was an error joining the room");
229+
}
227230
if (err.errcode === 'M_INCOMPATIBLE_ROOM_VERSION') {
228231
msg = <div>
229232
{_t("Sorry, your homeserver is too old to participate in this room.")}<br />

0 commit comments

Comments
 (0)