fix undefined error

Make sure unreadForChannel is defined before checking type.
This commit is contained in:
Thomas Zarebczan 2019-01-14 20:02:11 -05:00
parent b72ac5eb7d
commit 3321483395

View file

@ -73,7 +73,7 @@ export function doUpdateLoadStatus(uri: string, outpoint: string) {
const { claimName: channelName } = parseURI(channelUri);
const unreadForChannel = makeSelectUnreadByChannel(channelUri)(state);
if (unreadForChannel.type === NOTIFICATION_TYPES.DOWNLOADING) {
if (unreadForChannel && unreadForChannel.type === NOTIFICATION_TYPES.DOWNLOADING) {
const count = unreadForChannel.uris.length;
if (selectosNotificationsEnabled(state)) {