mirror of
https://github.com/element-hq/element-web
synced 2024-11-24 10:15:43 +03:00
Add responsible error handling because we're responsible people
This commit is contained in:
parent
2e3e2ec420
commit
d6adf0fd6d
2 changed files with 14 additions and 1 deletions
|
@ -164,7 +164,18 @@ export default class RolesRoomSettingsTab extends React.Component {
|
|||
if (!plContent['users']) plContent['users'] = {};
|
||||
plContent['users'][powerLevelKey] = value;
|
||||
|
||||
client.sendStateEvent(this.props.roomId, "m.room.power_levels", plContent);
|
||||
client.sendStateEvent(this.props.roomId, "m.room.power_levels", plContent).catch(e => {
|
||||
console.error(e);
|
||||
|
||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||
Modal.createTrackedDialog('Power level change failed', '', ErrorDialog, {
|
||||
title: _t('Error changing power level'),
|
||||
description: _t(
|
||||
"An error occurred changing the user's power level. Ensure you have sufficient " +
|
||||
"permissions and try again.",
|
||||
),
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
|
|
|
@ -689,6 +689,8 @@
|
|||
"Failed to unban": "Failed to unban",
|
||||
"Unban": "Unban",
|
||||
"Banned by %(displayName)s": "Banned by %(displayName)s",
|
||||
"Error changing power level": "Error changing power level",
|
||||
"An error occurred changing the user's power level. Ensure you have sufficient permissions and try again.": "An error occurred changing the user's power level. Ensure you have sufficient permissions and try again.",
|
||||
"Default role": "Default role",
|
||||
"Send messages": "Send messages",
|
||||
"Invite users": "Invite users",
|
||||
|
|
Loading…
Reference in a new issue