show dialog when failing to load profile info

pull/21833/head
Bruno Windels 2019-02-20 12:52:29 +01:00
parent f11505a9de
commit 23bcbc50e3
2 changed files with 8 additions and 2 deletions

View File

@ -18,7 +18,8 @@ import React from "react";
import Matrix from "matrix-js-sdk";
import MatrixClientPeg from "../../MatrixClientPeg";
import sdk from "../../index";
import Modal from '../../Modal';
import { _t } from '../../languageHandler';
export default class UserView extends React.Component {
static get propTypes() {
@ -51,7 +52,11 @@ export default class UserView extends React.Component {
try {
profileInfo = await cli.getProfileInfo(this.props.userId);
} catch (err) {
// show dialog or error or something
const ErrorDialog = sdk.getComponent('dialogs.ErrorDialog');
Modal.createTrackedDialog(_t('Could not load user profile'), '', ErrorDialog, {
title: _t('Could not load user profile'),
description: ((err && err.message) ? err.message : _t("Operation failed")),
});
this.setState({loading: false});
return;
}

View File

@ -1402,6 +1402,7 @@
"Uploading %(filename)s and %(count)s others|other": "Uploading %(filename)s and %(count)s others",
"Uploading %(filename)s and %(count)s others|zero": "Uploading %(filename)s",
"Uploading %(filename)s and %(count)s others|one": "Uploading %(filename)s and %(count)s other",
"Could not load user profile": "Could not load user profile",
"Failed to send email": "Failed to send email",
"The email address linked to your account must be entered.": "The email address linked to your account must be entered.",
"A new password must be entered.": "A new password must be entered.",