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:
parent
24c4c1edc7
commit
3bbff627fc
1 changed files with 8 additions and 1 deletions
|
@ -524,8 +524,15 @@ export default React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
_onSaveClick: function() {
|
_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});
|
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({
|
this.setState({
|
||||||
saving: false,
|
saving: false,
|
||||||
editing: false,
|
editing: false,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue