diff --git a/src/page/discover/view.js b/src/page/discover/view.js index 683deb2..59275ea 100644 --- a/src/page/discover/view.js +++ b/src/page/discover/view.js @@ -86,11 +86,9 @@ class DiscoverPage extends React.PureComponent { } onComponentFocused = () => { - const { fetchSubscriptions, pushDrawerStack } = this.props; + const { pushDrawerStack } = this.props; // pushDrawerStack(); - NativeModules.Firebase.setCurrentScreen('Your tags').then(result => { - fetchSubscriptions(); - }); + NativeModules.Firebase.setCurrentScreen('Your tags'); }; handleSortByItemSelected = item => { @@ -123,46 +121,6 @@ class DiscoverPage extends React.PureComponent { return null; }; - componentDidUpdate(prevProps, prevState) { - const { unreadSubscriptions, enabledChannelNotifications } = this.props; - - const utility = NativeModules.UtilityModule; - const hasUnread = - prevProps.unreadSubscriptions && - prevProps.unreadSubscriptions.length !== unreadSubscriptions.length && - unreadSubscriptions.length > 0; - - if (hasUnread) { - unreadSubscriptions.map(({ channel, uris }) => { - const { claimName: channelName } = parseURI(channel); - - // check if notifications are enabled for the channel - if (enabledChannelNotifications.includes(channelName)) { - uris.forEach(uri => { - Lbry.resolve({ urls: uri }).then(result => { - const sub = result[uri]; - - if (sub && sub.value) { - const { source, title, thumbnail } = sub.value; - const isPlayable = - source && source.media_type && ['audio', 'video'].includes(source.media_type.substring(0, 5)); - if (title) { - utility.showNotificationForContent( - uri, - title, - channelName, - thumbnail ? thumbnail.url : null, - isPlayable - ); - } - } - }); - }); - } - }); - } - } - showRatingReminder = () => { const { ratingReminderDisabled, ratingReminderLastShown, setClientSetting } = this.props; diff --git a/src/page/file/view.js b/src/page/file/view.js index ca60296..23c6af4 100644 --- a/src/page/file/view.js +++ b/src/page/file/view.js @@ -597,6 +597,18 @@ class FilePage extends React.PureComponent { setPlayerVisible(); }; + onDownloadPressed = () => { + const { claim, costInfo, purchaseUri } = this.props; + this.setState( + { + downloadPressed: true, + autoPlayMedia: false, + stopDownloadConfirmed: false, + }, + () => purchaseUri(claim.permanent_url, costInfo, true) + ); + }; + onBackButtonPressed = () => { const { navigation, drawerStack, popDrawerStack } = this.props; navigateBack(navigation, drawerStack, popDrawerStack); @@ -819,7 +831,7 @@ class FilePage extends React.PureComponent { {!this.state.fullscreenMode && } {this.state.showWebView && isWebViewable && ( - + )} {this.state.showImageViewer && ( @@ -938,48 +950,8 @@ class FilePage extends React.PureComponent { /> )} - {showActions && showFileActions && ( - - {showFileActions && ( - - {canEdit && ( -