Suppress CORS errors in the 'failed to join room' dialog
This isn't pretty, but it does address https://github.com/vector-im/riot-web/issues/7526 Tested with Chrome and Firefox to ensure the message is stable enough to parse.pull/21833/head
parent
0c6e98548e
commit
2b027b716f
|
@ -220,6 +220,7 @@
|
||||||
"Your browser does not support the required cryptography extensions": "Your browser does not support the required cryptography extensions",
|
"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",
|
"Not a valid Riot keyfile": "Not a valid Riot keyfile",
|
||||||
"Authentication check failed: incorrect password?": "Authentication check failed: incorrect password?",
|
"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.",
|
"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.",
|
"Please contact your homeserver administrator.": "Please contact your homeserver administrator.",
|
||||||
"Failed to join room": "Failed to join room",
|
"Failed to join room": "Failed to join room",
|
||||||
|
|
|
@ -224,6 +224,9 @@ class RoomViewStore extends Store {
|
||||||
err: err,
|
err: err,
|
||||||
});
|
});
|
||||||
let msg = err.message ? err.message : JSON.stringify(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') {
|
if (err.errcode === 'M_INCOMPATIBLE_ROOM_VERSION') {
|
||||||
msg = <div>
|
msg = <div>
|
||||||
{_t("Sorry, your homeserver is too old to participate in this room.")}<br />
|
{_t("Sorry, your homeserver is too old to participate in this room.")}<br />
|
||||||
|
|
Loading…
Reference in New Issue