Show an ErrorDialog when failing to forget a room

pull/21833/head
Kegan Dougal 2015-12-18 16:56:37 +00:00
parent c3bd81b83a
commit 461e3f46dc
1 changed files with 6 additions and 1 deletions

View File

@ -871,7 +871,12 @@ module.exports = React.createClass({
MatrixClientPeg.get().forget(this.props.roomId).done(function() {
dis.dispatch({ action: 'view_next_room' });
}, function(err) {
console.error("Failed to forget room: %s", err);
var errCode = err.errcode || "unknown error code";
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
Modal.createDialog(ErrorDialog, {
title: "Error",
description: `Failed to forget room (${errCode})`
});
});
},