diff --git a/res/css/structures/_GenericErrorPage.scss b/res/css/structures/_GenericErrorPage.scss index 44ea73444e..2b9e9f5e7d 100644 --- a/res/css/structures/_GenericErrorPage.scss +++ b/res/css/structures/_GenericErrorPage.scss @@ -12,7 +12,7 @@ right: 0; margin: auto; width: 500px; - height: 200px; + height: 125px; border: 1px solid #f22; padding: 10px 10px 20px; background-color: #fcc; diff --git a/res/css/structures/auth/_Login.scss b/res/css/structures/auth/_Login.scss index 4eff5c33e4..9ba46c09ab 100644 --- a/res/css/structures/auth/_Login.scss +++ b/res/css/structures/auth/_Login.scss @@ -62,6 +62,11 @@ limitations under the License. margin-bottom: 12px; } +.mx_Login_error.mx_Login_serverError { + text-align: left; + font-weight: normal; +} + .mx_Login_type_container { display: flex; align-items: center; diff --git a/src/components/structures/GenericErrorPage.js b/src/components/structures/GenericErrorPage.js index 3d8e68cea7..ab7d4f9311 100644 --- a/src/components/structures/GenericErrorPage.js +++ b/src/components/structures/GenericErrorPage.js @@ -16,22 +16,18 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; -import {_t} from "../../languageHandler"; export default class GenericErrorPage extends React.PureComponent { static propTypes = { + title: PropTypes.object.isRequired, // jsx for title message: PropTypes.object.isRequired, // jsx to display }; render() { return
{this.props.message}
-{_t( - "If this is unexpected, please contact your system administrator " + - "or technical support representative.", - )}
\n Use the long description to introduce new members to the community, or distribute\n some important links\n
\n\n You can even use 'img' tags\n
\n": "\n Use the long description to introduce new members to the community, or distribute\n some important links\n
\n\n You can even use 'img' tags\n
\n", "Add rooms to the community summary": "Add rooms to the community summary", "Which rooms would you like to add to this summary?": "Which rooms would you like to add to this summary?", diff --git a/src/utils/AutoDiscoveryUtils.js b/src/utils/AutoDiscoveryUtils.js index 26596bdbb8..8b13fff368 100644 --- a/src/utils/AutoDiscoveryUtils.js +++ b/src/utils/AutoDiscoveryUtils.js @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +import React from 'react'; import {AutoDiscovery} from "matrix-js-sdk"; import {_t, _td, newTranslatableError} from "../languageHandler"; import {makeType} from "./TypeUtils"; @@ -56,19 +57,33 @@ export default class AutoDiscoveryUtils { * for the component, given the error. */ static authComponentStateForError(err: Error): {serverIsAlive: boolean, serverDeadError: string} { - if (AutoDiscoveryUtils.isLivelinessError(err)) { - // TODO: TravisR - Copy from Nad - return { - serverIsAlive: false, - serverDeadError: _t("Server failed liveliness check"), - }; - } else { - // TODO: TravisR - Copy from Nad - return { - serverIsAlive: false, - serverDeadError: _t("Server failed syntax check"), - }; + let title = _t("Cannot reach homeserver"); + let body = _t("Ensure you have a stable internet connection, or get in touch with the server admin"); + if (!AutoDiscoveryUtils.isLivelinessError(err)) { + title = _t("Your Riot is misconfigured"); + body = _t( + "Ask your Riot admin to check your config for incorrect or duplicate entries.", + {}, { + a: (sub) => { + return {sub}; + } + }, + ); } + + return { + serverIsAlive: false, + serverDeadError: ( +