Add bunch of null-guards and similar to fix React Errors/complaints

This commit is contained in:
Michael Telatynski 2019-12-19 15:10:54 +00:00
parent 29523000dc
commit 709b2eed7c
5 changed files with 16 additions and 7 deletions

View file

@ -32,7 +32,7 @@ export default createReactClass({
return {
busy: false,
ready: false,
isGroupPublicised: null,
isGroupPublicised: false, // assume false as <ToggleSwitch /> expects a boolean
};
},
@ -43,7 +43,7 @@ export default createReactClass({
_initGroupStore: function(groupId) {
this._groupStoreToken = GroupStore.registerListener(groupId, () => {
this.setState({
isGroupPublicised: GroupStore.getGroupPublicity(groupId),
isGroupPublicised: Boolean(GroupStore.getGroupPublicity(groupId)),
ready: GroupStore.isStateReady(groupId, GroupStore.STATE_KEY.Summary),
});
});