Allow saving room topic or name only

This changes the room profile settings to support saving _only_ the room topic or
name in case you have limited access to set one but not the other.

Fixes https://github.com/vector-im/element-web/issues/16375
pull/21833/head
J. Ryan Stinnett 2021-02-05 13:34:06 +00:00
parent 15a4032be0
commit bffce8689a
1 changed files with 6 additions and 2 deletions

View File

@ -81,7 +81,11 @@ export default class RoomProfileSettings extends React.Component {
if (!this.state.enableProfileSave) return;
this._removeAvatar();
this.setState({enableProfileSave: false, displayName: this.state.originalDisplayName});
this.setState({
enableProfileSave: false,
displayName: this.state.originalDisplayName,
topic: this.state.originalTopic,
});
};
_saveProfile = async (e) => {
@ -164,7 +168,7 @@ export default class RoomProfileSettings extends React.Component {
const AvatarSetting = sdk.getComponent('settings.AvatarSetting');
let profileSettingsButtons;
if (this.state.canSetTopic && this.state.canSetName) {
if (this.state.canSetTopic || this.state.canSetName) {
profileSettingsButtons = (
<div className="mx_ProfileSettings_buttons">
<AccessibleButton