Better error message for failing to set avatars with no connection
This commit is contained in:
parent
abb170ebde
commit
05d1d7c82d
1 changed files with 6 additions and 6 deletions
|
@ -90,17 +90,17 @@ module.exports = React.createClass({
|
||||||
console.error("No ChangeAvatar found to upload image to!");
|
console.error("No ChangeAvatar found to upload image to!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
changeAvatar.onFileSelected(ev).catch(function(err) {
|
changeAvatar.onFileSelected(ev).done(function() {
|
||||||
var errMsg = err.error || "";
|
// dunno if the avatar changed, re-check it.
|
||||||
|
self._refreshFromServer();
|
||||||
|
}, function(err) {
|
||||||
|
var errMsg = (typeof err === "string") ? err : (err.error || "");
|
||||||
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||||
Modal.createDialog(ErrorDialog, {
|
Modal.createDialog(ErrorDialog, {
|
||||||
title: "Error",
|
title: "Error",
|
||||||
description: "Failed to set avatar. " + errMsg
|
description: "Failed to set avatar. " + errMsg
|
||||||
});
|
});
|
||||||
}).finally(function() {
|
});
|
||||||
// dunno if the avatar changed, re-check it.
|
|
||||||
self._refreshFromServer();
|
|
||||||
}).done();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onLogoutClicked: function(ev) {
|
onLogoutClicked: function(ev) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue