From bffce8689a435eb876fe0f7accfa97a6a664ea81 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Fri, 5 Feb 2021 13:34:06 +0000 Subject: [PATCH] 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 --- src/components/views/room_settings/RoomProfileSettings.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/views/room_settings/RoomProfileSettings.js b/src/components/views/room_settings/RoomProfileSettings.js index c76c0823e4..e90dab3b97 100644 --- a/src/components/views/room_settings/RoomProfileSettings.js +++ b/src/components/views/room_settings/RoomProfileSettings.js @@ -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 = (