From e196cfaf910a9faff96c53a7ac84eb8fe33c2b00 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Fri, 13 Jan 2017 14:51:01 +0000 Subject: [PATCH 1/2] Show the error dialog when requests to PUT power levels fail This is why I dislike Q. --- src/components/views/rooms/MemberInfo.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/views/rooms/MemberInfo.js b/src/components/views/rooms/MemberInfo.js index d57bf4bce1..5ccb633d8a 100644 --- a/src/components/views/rooms/MemberInfo.js +++ b/src/components/views/rooms/MemberInfo.js @@ -376,6 +376,7 @@ module.exports = WithMatrixClient(React.createClass({ // get out of sync if we force setState here! console.log("Power change success"); }, function(err) { + var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createDialog(ErrorDialog, { title: "Failure to change power level", description: err.message From dcd0acb2b5f0f6ed50bb96fd750482d6b59ccf8d Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Fri, 13 Jan 2017 15:17:34 +0000 Subject: [PATCH 2/2] Review comments --- src/components/views/rooms/MemberInfo.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/MemberInfo.js b/src/components/views/rooms/MemberInfo.js index 5ccb633d8a..1f4d392461 100644 --- a/src/components/views/rooms/MemberInfo.js +++ b/src/components/views/rooms/MemberInfo.js @@ -376,7 +376,7 @@ module.exports = WithMatrixClient(React.createClass({ // get out of sync if we force setState here! console.log("Power change success"); }, function(err) { - var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); + const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); Modal.createDialog(ErrorDialog, { title: "Failure to change power level", description: err.message @@ -384,7 +384,7 @@ module.exports = WithMatrixClient(React.createClass({ } ).finally(()=>{ this.setState({ updating: this.state.updating - 1 }); - }); + }).done(); this.props.onFinished(); },