diff --git a/LICENSE b/LICENSE
index 08b5886..eb958df 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2017-2018 LBRY Inc
+Copyright (c) 2017-2019 LBRY Inc
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
diff --git a/package-lock.json b/package-lock.json
index 1d0eb6f..b742d5b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -5640,8 +5640,8 @@
}
},
"lbry-redux": {
- "version": "github:lbryio/lbry-redux#23bcde0539a27fb19bf3a7d87683279194e02046",
- "from": "github:lbryio/lbry-redux#23bcde0539a27fb19bf3a7d87683279194e02046",
+ "version": "github:lbryio/lbry-redux#f06e1e64a8587a183bd7333f628fca821fe81fa4",
+ "from": "github:lbryio/lbry-redux#f06e1e64a8587a183bd7333f628fca821fe81fa4",
"requires": {
"proxy-polyfill": "0.1.6",
"reselect": "^3.0.0",
@@ -5649,8 +5649,8 @@
}
},
"lbryinc": {
- "version": "github:lbryio/lbryinc#67bb3e215be3f13605c5e3f9f2b0e2fb880724cf",
- "from": "github:lbryio/lbryinc#67bb3e215be3f13605c5e3f9f2b0e2fb880724cf",
+ "version": "github:lbryio/lbryinc#02d8571cd7fafd00d1a60f133d884eb8c5f1a306",
+ "from": "github:lbryio/lbryinc#02d8571cd7fafd00d1a60f133d884eb8c5f1a306",
"requires": {
"reselect": "^3.0.0"
}
diff --git a/src/component/modalSuggestedSubscriptions/index.js b/src/component/modalSuggestedSubscriptions/index.js
new file mode 100644
index 0000000..6eef7f4
--- /dev/null
+++ b/src/component/modalSuggestedSubscriptions/index.js
@@ -0,0 +1,4 @@
+import { connect } from 'react-redux';
+import ModalSuggestedSubscriptions from './view';
+
+export default connect()(ModalSuggestedSubscriptions);
diff --git a/src/component/modalSuggestedSubscriptions/view.js b/src/component/modalSuggestedSubscriptions/view.js
new file mode 100644
index 0000000..0c8765e
--- /dev/null
+++ b/src/component/modalSuggestedSubscriptions/view.js
@@ -0,0 +1,26 @@
+import React from 'react';
+import { ScrollView, Text, TouchableOpacity, View } from 'react-native';
+import modalStyle from 'styles/modal';
+import subscriptionsStyle from 'styles/subscriptions';
+import Button from 'component/button';
+import Colors from 'styles/colors';
+import SuggestedSubscriptions from 'component/suggestedSubscriptions';
+import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
+import Icon from 'react-native-vector-icons/FontAwesome5';
+
+export default class ModalSuggestedSubcriptions extends React.PureComponent {
+ render() {
+ const { navigation, onDonePress, onOverlayPress } = this.props;
+
+ return (
+
+
+
+
+
+
+
+
+ );
+ }
+}
diff --git a/src/component/suggestedSubscriptions/index.js b/src/component/suggestedSubscriptions/index.js
index 9228cea..4d940cc 100644
--- a/src/component/suggestedSubscriptions/index.js
+++ b/src/component/suggestedSubscriptions/index.js
@@ -1,6 +1,7 @@
import { connect } from 'react-redux';
import { doClaimSearch, selectFetchingClaimSearch, selectClaimSearchByQuery, selectFollowedTags } from 'lbry-redux';
import { selectSuggestedChannels, selectIsFetchingSuggested } from 'lbryinc';
+import { selectShowNsfw } from 'redux/selectors/settings';
import SuggestedSubscriptions from './view';
const select = state => ({
@@ -8,6 +9,7 @@ const select = state => ({
suggested: selectSuggestedChannels(state),
loading: selectIsFetchingSuggested(state) || selectFetchingClaimSearch(state),
claimSearchByQuery: selectClaimSearchByQuery(state),
+ showNsfwContent: selectShowNsfw(state),
});
const perform = dispatch => ({
diff --git a/src/component/suggestedSubscriptions/view.js b/src/component/suggestedSubscriptions/view.js
index 4afc2a3..e067988 100644
--- a/src/component/suggestedSubscriptions/view.js
+++ b/src/component/suggestedSubscriptions/view.js
@@ -1,6 +1,6 @@
import React from 'react';
-import { ActivityIndicator, FlatList, SectionList, Text, View } from 'react-native';
-import { createNormalizedClaimSearchKey, normalizeURI } from 'lbry-redux';
+import { ActivityIndicator, SectionList, Text, View } from 'react-native';
+import { MATURE_TAGS, createNormalizedClaimSearchKey, normalizeURI } from 'lbry-redux';
import { __, navigateToUri } from 'utils/helper';
import SubscribeButton from 'component/subscribeButton';
import SuggestedSubscriptionItem from 'component/suggestedSubscriptionItem';
@@ -16,13 +16,16 @@ class SuggestedSubscriptions extends React.PureComponent {
};
componentDidMount() {
- const { claimSearch, followedTags } = this.props;
+ const { claimSearch, followedTags, showNsfwContent } = this.props;
const options = {
any_tags: _.shuffle(followedTags.map(tag => tag.name)).slice(0, 3),
page: 1,
no_totals: true,
claim_type: 'channel',
};
+ if (!showNsfwContent) {
+ options.not_tags = MATURE_TAGS;
+ }
this.setState({ options });
claimSearch(options);
}
@@ -35,7 +38,7 @@ class SuggestedSubscriptions extends React.PureComponent {
const suggestedUris = suggested ? suggested.map(suggested => suggested.uri) : [];
return [
{
- title: __('Tags you follow'),
+ title: __('Suggested channels'),
data: claimSearchUris ? claimSearchUris.filter(uri => !suggestedUris.includes(uri)) : [],
},
{
@@ -46,7 +49,7 @@ class SuggestedSubscriptions extends React.PureComponent {
};
render() {
- const { suggested, loading, navigation } = this.props;
+ const { suggested, inModal, loading, navigation } = this.props;
if (loading) {
return (
@@ -58,8 +61,10 @@ class SuggestedSubscriptions extends React.PureComponent {
return (
(
)}
diff --git a/src/page/discover/view.js b/src/page/discover/view.js
index efcd203..96394be 100644
--- a/src/page/discover/view.js
+++ b/src/page/discover/view.js
@@ -61,11 +61,10 @@ class DiscoverPage extends React.PureComponent {
}
});
- const { sortByItem, fetchRewardedContent, fetchSubscriptions, fileList, followedTags } = this.props;
+ const { sortByItem, fetchRewardedContent, fileList, followedTags } = this.props;
this.buildTagCollection(followedTags);
fetchRewardedContent();
- fetchSubscriptions();
fileList();
this.handleSortByItemSelected(sortByItem);
@@ -88,9 +87,11 @@ class DiscoverPage extends React.PureComponent {
}
onComponentFocused = () => {
- const { pushDrawerStack } = this.props;
+ const { fetchSubscriptions, pushDrawerStack } = this.props;
// pushDrawerStack();
- NativeModules.Firebase.setCurrentScreen('Your tags');
+ NativeModules.Firebase.setCurrentScreen('Your tags').then(result => {
+ fetchSubscriptions();
+ });
};
handleSortByItemSelected = item => {
@@ -127,44 +128,39 @@ class DiscoverPage extends React.PureComponent {
const { unreadSubscriptions, enabledChannelNotifications } = this.props;
const utility = NativeModules.UtilityModule;
- if (utility) {
- const hasUnread =
- prevProps.unreadSubscriptions &&
- prevProps.unreadSubscriptions.length !== unreadSubscriptions.length &&
- unreadSubscriptions.length > 0;
+ const hasUnread =
+ prevProps.unreadSubscriptions &&
+ prevProps.unreadSubscriptions.length !== unreadSubscriptions.length &&
+ unreadSubscriptions.length > 0;
- if (hasUnread) {
- unreadSubscriptions.map(({ channel, uris }) => {
- const { claimName: channelName } = parseURI(channel);
+ if (hasUnread) {
+ unreadSubscriptions.map(({ channel, uris }) => {
+ const { claimName: channelName } = parseURI(channel);
- // check if notifications are enabled for the channel
- if (enabledChannelNotifications.indexOf(channelName) > -1) {
- uris.forEach(uri => {
- Lbry.resolve({ urls: uri }).then(result => {
- const sub = result[uri].claim;
- if (sub && sub.value && sub.value.stream) {
- let isPlayable = false;
- const source = sub.value.stream.source;
- const metadata = sub.value.stream.metadata;
- if (source) {
- isPlayable =
- source.contentType && ['audio', 'video'].indexOf(source.contentType.substring(0, 5)) > -1;
- }
- if (metadata) {
- utility.showNotificationForContent(
- uri,
- metadata.title,
- channelName,
- metadata.thumbnail,
- isPlayable
- );
- }
+ // 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
+ );
}
- });
+ }
});
- }
- });
- }
+ });
+ }
+ });
}
}
diff --git a/src/page/file/view.js b/src/page/file/view.js
index 8ab5f85..ea9d4c7 100644
--- a/src/page/file/view.js
+++ b/src/page/file/view.js
@@ -6,6 +6,7 @@ import {
Alert,
DeviceEventEmitter,
Dimensions,
+ Linking,
NativeModules,
ScrollView,
StatusBar,
@@ -968,6 +969,12 @@ class FilePage extends React.PureComponent {
onPress={this.onSaveFilePressed}
/>
)}
+