Merge pull request #3407 from matrix-org/t3chguy/fix_custom_pl_levels_hidden_error
Catch error from changing room power level requirements and show modal
This commit is contained in:
commit
c6f3ca20c0
2 changed files with 14 additions and 1 deletions
|
@ -148,7 +148,18 @@ export default class RolesRoomSettingsTab extends React.Component {
|
||||||
parentObj[keyPath[keyPath.length - 1]] = value;
|
parentObj[keyPath[keyPath.length - 1]] = 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 requirement change failed', '', ErrorDialog, {
|
||||||
|
title: _t('Error changing power level requirement'),
|
||||||
|
description: _t(
|
||||||
|
"An error occurred changing the room's power level requirements. Ensure you have sufficient " +
|
||||||
|
"permissions and try again.",
|
||||||
|
),
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
_onUserPowerLevelChanged = (value, powerLevelKey) => {
|
_onUserPowerLevelChanged = (value, powerLevelKey) => {
|
||||||
|
|
|
@ -695,6 +695,8 @@
|
||||||
"Failed to unban": "Failed to unban",
|
"Failed to unban": "Failed to unban",
|
||||||
"Unban": "Unban",
|
"Unban": "Unban",
|
||||||
"Banned by %(displayName)s": "Banned by %(displayName)s",
|
"Banned by %(displayName)s": "Banned by %(displayName)s",
|
||||||
|
"Error changing power level requirement": "Error changing power level requirement",
|
||||||
|
"An error occurred changing the room's power level requirements. Ensure you have sufficient permissions and try again.": "An error occurred changing the room's power level requirements. Ensure you have sufficient permissions and try again.",
|
||||||
"Error changing power level": "Error changing power level",
|
"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.",
|
"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",
|
"Default role": "Default role",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue