You've already forked element-web
mirror of
https://github.com/element-hq/element-web.git
synced 2025-11-29 21:23:11 +03:00
Fix bug preventing partial group profile
When updating the group profile, send empty strings instead of `null` as synapse does not expect `null`.
This commit is contained in:
@@ -524,8 +524,15 @@ export default React.createClass({
|
||||
},
|
||||
|
||||
_onSaveClick: function() {
|
||||
const newGroupProfile = this.state.profileForm;
|
||||
// Synapse is not expecting `null`, so map unset values to the empty string
|
||||
Object.keys(newGroupProfile).forEach((k) => {
|
||||
if (!newGroupProfile[k]) {
|
||||
newGroupProfile[k] = '';
|
||||
}
|
||||
});
|
||||
this.setState({saving: true});
|
||||
MatrixClientPeg.get().setGroupProfile(this.props.groupId, this.state.profileForm).then((result) => {
|
||||
MatrixClientPeg.get().setGroupProfile(this.props.groupId, newGroupProfile).then((result) => {
|
||||
this.setState({
|
||||
saving: false,
|
||||
editing: false,
|
||||
|
||||
Reference in New Issue
Block a user