From 463212fb2a28347f1a0ebb73e7299f79d0c43c7b Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 22 Mar 2016 13:19:29 +0000 Subject: [PATCH] Update error message --- .../views/room_settings/ColorSettings.js | 2 +- src/components/views/rooms/MemberInfo.js | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/components/views/room_settings/ColorSettings.js b/src/components/views/room_settings/ColorSettings.js index ad0b1fe070..fff97ea817 100644 --- a/src/components/views/room_settings/ColorSettings.js +++ b/src/components/views/room_settings/ColorSettings.js @@ -89,7 +89,7 @@ module.exports = React.createClass({ var NeedToRegisterDialog = sdk.getComponent("dialogs.NeedToRegisterDialog"); Modal.createDialog(NeedToRegisterDialog, { title: "Please Register", - description: "Guest users can't create new rooms. Please register to create room and start a chat." + description: "Saving room color settings is only available to registered users" }); } }); diff --git a/src/components/views/rooms/MemberInfo.js b/src/components/views/rooms/MemberInfo.js index a79d90adbc..feb4a30bde 100644 --- a/src/components/views/rooms/MemberInfo.js +++ b/src/components/views/rooms/MemberInfo.js @@ -170,10 +170,18 @@ module.exports = React.createClass({ // get out of sync if we force setState here! console.log("Mod toggle success"); }, function(err) { - Modal.createDialog(ErrorDialog, { - title: "Mod error", - description: err.message - }); + if (err.errcode == 'M_GUEST_ACCESS_FORBIDDEN') { + var NeedToRegisterDialog = sdk.getComponent("dialogs.NeedToRegisterDialog"); + Modal.createDialog(NeedToRegisterDialog, { + title: "Please Register", + description: "This action cannot be performed by a guest user. Please register to be able to do this." + }); + } else { + Modal.createDialog(ErrorDialog, { + title: "Mod error", + description: err.message + }); + } } ); this.props.onFinished();