only dispatch count if the user is present

this prevents a console error
This commit is contained in:
Matthew Taylor 2017-09-06 14:25:44 -04:00
parent ce88466ee4
commit 7945a7eff1

View file

@ -97,7 +97,9 @@ module.exports.refreshSession = function () {
// get the permissions from the updated session
dispatch(permissionsActions.storePermissions(body.permissions));
dispatch(messageCountActions.getCount(body.user.username));
if (typeof body.user !== 'undefined') {
dispatch(messageCountActions.getCount(body.user.username));
}
return;
}
});