From fc30e8575c1200f374ec174eefa480b05a2a5b56 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Wed, 2 Oct 2019 10:35:03 +0100 Subject: [PATCH] fixes as per review --- src/page/discover/view.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/page/discover/view.js b/src/page/discover/view.js index 34794e7..96394be 100644 --- a/src/page/discover/view.js +++ b/src/page/discover/view.js @@ -138,17 +138,15 @@ class DiscoverPage extends React.PureComponent { const { claimName: channelName } = parseURI(channel); // check if notifications are enabled for the channel - if (enabledChannelNotifications.indexOf(channelName) > -1) { + if (enabledChannelNotifications.includes(channelName)) { uris.forEach(uri => { Lbry.resolve({ urls: uri }).then(result => { const sub = result[uri]; if (sub && sub.value) { - let isPlayable = false; const { source, title, thumbnail } = sub.value; - if (source) { - isPlayable = source.media_type && ['audio', 'video'].indexOf(source.media_type.substring(0, 5)) > -1; - } + const isPlayable = + source && source.media_type && ['audio', 'video'].includes(source.media_type.substring(0, 5)); if (title) { utility.showNotificationForContent( uri,