You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +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() {
|
_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,
|
||||||
|
Reference in New Issue
Block a user