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:
Luke Barnard 2017-10-17 17:26:34 +01:00
parent 24c4c1edc7
commit 3bbff627fc

View file

@ -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,