mirror of https://github.com/vector-im/riot-web
Merge pull request #1491 from matrix-org/luke/groups-fix-optional-profile-properties
Fix bug preventing partial group profilepull/21833/head
commit
62a79d823d
|
@ -448,8 +448,16 @@ export default React.createClass({
|
|||
_initGroupStore: function(groupId) {
|
||||
this._groupStore = GroupStoreCache.getGroupStore(MatrixClientPeg.get(), groupId);
|
||||
this._groupStore.on('update', () => {
|
||||
const summary = this._groupStore.getSummary();
|
||||
if (summary.profile) {
|
||||
// Default profile fields should be "" for later sending to the server (which
|
||||
// requires that the fields are strings, not null)
|
||||
["avatar_url", "long_description", "name", "short_description"].forEach((k) => {
|
||||
summary.profile[k] = summary.profile[k] || "";
|
||||
});
|
||||
}
|
||||
this.setState({
|
||||
summary: this._groupStore.getSummary(),
|
||||
summary,
|
||||
error: null,
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue