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

Suppress CORS errors in the 'failed to join room' dialog #2306

Merged
merged 3 commits into from
Dec 5, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
"Your browser does not support the required cryptography extensions": "Your browser does not support the required cryptography extensions",
"Not a valid Riot keyfile": "Not a valid Riot keyfile",
"Authentication check failed: incorrect password?": "Authentication check failed: incorrect password?",
"There was an error joining the room": "There was an error joining the room",
"Sorry, your homeserver is too old to participate in this room.": "Sorry, your homeserver is too old to participate in this room.",
"Please contact your homeserver administrator.": "Please contact your homeserver administrator.",
"Failed to join room": "Failed to join room",
Expand Down
3 changes: 3 additions & 0 deletions src/stores/RoomViewStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ class RoomViewStore extends Store {
err: err,
});
let msg = err.message ? err.message : JSON.stringify(err);
if (msg && msg.startsWith("CORS request rejected")) {
msg = _t("There was an error joining the room");
}
if (err.errcode === 'M_INCOMPATIBLE_ROOM_VERSION') {
msg = <div>
{_t("Sorry, your homeserver is too old to participate in this room.")}<br />
Expand Down