Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6116bd3809 | ||
|
|
40e2080c52 | ||
|
|
7294848802 | ||
|
|
0042b4ce43 | ||
|
|
8e99074ba4 | ||
|
|
6f891c8b27 | ||
|
|
0202054edb | ||
|
|
e541dcc381 | ||
|
|
156c3e1a72 | ||
|
|
b0c5b6f062 | ||
|
|
381e780d8d |
No files matched your search
+1
-1
Submodule android updated: e9f2554697...b7b6c05bd3.
Generated
+12178
File diff suppressed because it is too large.
Load diff
+2
-2
@@ -15,8 +15,8 @@
|
||||
"base-64": "^0.1.0",
|
||||
"@expo/vector-icons": "^8.1.0",
|
||||
"gfycat-style-urls": "^1.0.3",
|
||||
"lbry-redux": "lbryio/lbry-redux#69ffd110dbf3633e5847f61f008751edec033017",
|
||||
"lbryinc": "lbryio/lbryinc#021ac75d9aa2db488cfff8e9be320402f038f955",
|
||||
"lbry-redux": "lbryio/lbry-redux#f6e99498d2bc5b3f07e1e2b6f668a1a48de35047",
|
||||
"lbryinc": "lbryio/lbryinc#1fc104c2d29d1d3975234c3606e848eaa28e1b6e",
|
||||
"lodash": ">=4.17.11",
|
||||
"merge": ">=1.2.1",
|
||||
"moment": "^2.22.1",
|
||||
|
||||
@@ -42,10 +42,8 @@ import {
|
||||
} from 'react-native';
|
||||
import { selectDrawerStack } from 'redux/selectors/drawer';
|
||||
import {
|
||||
Lbry,
|
||||
ACTIONS,
|
||||
SETTINGS,
|
||||
doBalanceSubscribe,
|
||||
doDismissToast,
|
||||
doPopulateSharedUserState,
|
||||
doPreferenceGet,
|
||||
@@ -54,8 +52,6 @@ import {
|
||||
} from 'lbry-redux';
|
||||
import {
|
||||
Lbryio,
|
||||
doBlackListedOutpointsSubscribe,
|
||||
doFilteredOutpointsSubscribe,
|
||||
doGetSync,
|
||||
doUserCheckEmailVerified,
|
||||
doUserEmailVerify,
|
||||
@@ -79,7 +75,6 @@ import discoverStyle from 'styles/discover';
|
||||
import searchStyle from 'styles/search';
|
||||
import SearchRightHeaderIcon from 'component/searchRightHeaderIcon';
|
||||
import Snackbar from 'react-native-snackbar';
|
||||
import { doSetSdkReady } from 'redux/actions/settings';
|
||||
|
||||
const SYNC_GET_INTERVAL = 1000 * 60 * 5; // every 5 minutes
|
||||
|
||||
@@ -317,6 +312,8 @@ class AppWithNavigationState extends React.Component {
|
||||
'hardwareBackPress',
|
||||
function() {
|
||||
const { dispatch, nav, drawerStack } = this.props;
|
||||
console.log(nav);
|
||||
|
||||
if (drawerStack.length > 1) {
|
||||
dispatchNavigateBack(dispatch, nav, drawerStack);
|
||||
return true;
|
||||
@@ -332,7 +329,6 @@ class AppWithNavigationState extends React.Component {
|
||||
this.emailVerifyCheckInterval = setInterval(() => this.checkEmailVerification(), 5000);
|
||||
Linking.addEventListener('url', this._handleUrl);
|
||||
|
||||
DeviceEventEmitter.addListener('onSdkReady', this.handleSdkReady);
|
||||
DeviceEventEmitter.addListener('onDownloadAborted', this.handleDownloadAborted);
|
||||
DeviceEventEmitter.addListener('onDownloadStarted', this.handleDownloadStarted);
|
||||
DeviceEventEmitter.addListener('onDownloadUpdated', this.handleDownloadUpdated);
|
||||
@@ -372,46 +368,6 @@ class AppWithNavigationState extends React.Component {
|
||||
);
|
||||
};
|
||||
|
||||
handleSdkReady = () => {
|
||||
const { dispatch } = this.props;
|
||||
dispatch(doSetSdkReady());
|
||||
dispatch(doBalanceSubscribe());
|
||||
dispatch(doBlackListedOutpointsSubscribe());
|
||||
dispatch(doFilteredOutpointsSubscribe());
|
||||
|
||||
Lbry.wallet_status().then(secureWalletStatus => {
|
||||
// For now, automatically unlock the wallet if a password is set so that downloads work
|
||||
NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(password => {
|
||||
if ((secureWalletStatus.is_encrypted && !secureWalletStatus.is_locked) || secureWalletStatus.is_locked) {
|
||||
this.setState({
|
||||
message: __('Unlocking account'),
|
||||
details: __('Decrypting wallet'),
|
||||
});
|
||||
|
||||
// unlock the wallet and then finish the splash screen
|
||||
Lbry.wallet_unlock({ password: password || '' }).then(unlocked => {
|
||||
if (unlocked) {
|
||||
} else {
|
||||
// this.handleAccountUnlockFailed();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
handleAccountUnlockFailed() {
|
||||
const { dispatch } = this.props;
|
||||
dispatch(
|
||||
doToast({
|
||||
message: __(
|
||||
'Your wallet failed to unlock, which means you may not be able to play any videos or access your funds. Restart the app to fix this.',
|
||||
),
|
||||
isError: true,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
handleDownloadStarted = evt => {
|
||||
const { dispatch } = this.props;
|
||||
const { uri, outpoint, fileInfo } = evt;
|
||||
@@ -447,7 +403,6 @@ class AppWithNavigationState extends React.Component {
|
||||
};
|
||||
|
||||
componentWillUnmount() {
|
||||
DeviceEventEmitter.removeListener('onSdkReady', this.handleSdkReady);
|
||||
DeviceEventEmitter.removeListener('onDownloadAborted', this.handleDownloadAborted);
|
||||
DeviceEventEmitter.removeListener('onDownloadStarted', this.handleDownloadStarted);
|
||||
DeviceEventEmitter.removeListener('onDownloadUpdated', this.handleDownloadUpdated);
|
||||
|
||||
@@ -19,4 +19,7 @@ const perform = dispatch => ({
|
||||
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(ChannelIconItem);
|
||||
export default connect(
|
||||
select,
|
||||
perform
|
||||
)(ChannelIconItem);
|
||||
@@ -23,4 +23,7 @@ const perform = dispatch => ({
|
||||
claimSearch: options => dispatch(doClaimSearch(options)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(ClaimList);
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
)(ClaimList);
|
||||
@@ -36,4 +36,7 @@ const perform = dispatch => ({
|
||||
setPlayerVisible: (visible, uri) => dispatch(doSetPlayerVisible(visible, uri)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(ClaimResultItem);
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
)(ClaimResultItem);
|
||||
@@ -1,17 +1,18 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doToast, selectMyChannelClaims } from 'lbry-redux';
|
||||
import { doFetchChannelListMine, selectMyChannelClaims } from 'lbry-redux';
|
||||
import { selectUser } from 'lbryinc';
|
||||
import { selectSdkReady } from 'redux/selectors/settings';
|
||||
import DrawerContent from './view';
|
||||
|
||||
const select = state => ({
|
||||
channels: selectMyChannelClaims(state),
|
||||
sdkReady: selectSdkReady(state),
|
||||
user: selectUser(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
notify: data => dispatch(doToast(data)),
|
||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine(1, 99999, true)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(DrawerContent);
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
)(DrawerContent);
|
||||
@@ -31,17 +31,13 @@ const groupedMenuItems = {
|
||||
};
|
||||
|
||||
const groupNames = Object.keys(groupedMenuItems);
|
||||
const routesRequiringSdkReady = [
|
||||
Constants.DRAWER_ROUTE_CHANNEL_CREATOR,
|
||||
Constants.DRAWER_ROUTE_MY_LBRY,
|
||||
Constants.DRAWER_ROUTE_PUBLISHES,
|
||||
Constants.DRAWER_ROUTE_PUBLISH,
|
||||
Constants.DRAWER_ROUTE_WALLET,
|
||||
Constants.DRAWER_ROUTE_REWARDS,
|
||||
Constants.DRAWER_ROUTE_INVITES,
|
||||
];
|
||||
|
||||
class DrawerContent extends React.PureComponent {
|
||||
componentDidMount() {
|
||||
const { fetchChannelListMine } = this.props;
|
||||
fetchChannelListMine();
|
||||
}
|
||||
|
||||
getAvatarImageUrl = () => {
|
||||
const { channels = [] } = this.props;
|
||||
if (channels) {
|
||||
@@ -66,21 +62,6 @@ class DrawerContent extends React.PureComponent {
|
||||
});
|
||||
};
|
||||
|
||||
handleItemPress = routeName => {
|
||||
const { navigation, notify, sdkReady } = this.props;
|
||||
if (!sdkReady && routesRequiringSdkReady.includes(routeName)) {
|
||||
if (navigation.closeDrawer) {
|
||||
navigation.closeDrawer();
|
||||
}
|
||||
notify({
|
||||
message: __('The background service is still initializing. Please try again when initialization is complete.'),
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
navigation.navigate({ routeName: routeName });
|
||||
};
|
||||
|
||||
render() {
|
||||
const { activeTintColor, navigation, user, onItemPress } = this.props;
|
||||
const { state } = navigation;
|
||||
@@ -176,7 +157,7 @@ class DrawerContent extends React.PureComponent {
|
||||
focused ? discoverStyle.menuItemTouchAreaFocused : null,
|
||||
]}
|
||||
key={item.label}
|
||||
onPress={() => this.handleItemPress(item.route)}
|
||||
onPress={() => navigation.navigate({ routeName: item.route })}
|
||||
delayPressIn={0}
|
||||
>
|
||||
<View style={discoverStyle.menuItemIcon}>
|
||||
|
||||
@@ -35,4 +35,7 @@ const perform = dispatch => ({
|
||||
setPlayerVisible: (visible, uri) => dispatch(doSetPlayerVisible(visible, uri)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(FileItem);
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
)(FileItem);
|
||||
@@ -36,4 +36,7 @@ const perform = dispatch => ({
|
||||
setPlayerVisible: (visible, uri) => dispatch(doSetPlayerVisible(visible, uri)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(FileListItem);
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
)(FileListItem);
|
||||
@@ -125,9 +125,7 @@ class FileListItem extends React.PureComponent {
|
||||
const outpointsToHide = !blackListedOutpoints
|
||||
? filteredOutpoints
|
||||
: blackListedOutpoints.concat(filteredOutpoints);
|
||||
shouldHide = outpointsToHide.some(
|
||||
outpoint => outpoint && outpoint.txid === claim.txid && outpoint.nout === claim.nout,
|
||||
);
|
||||
shouldHide = outpointsToHide.some(outpoint => outpoint.txid === claim.txid && outpoint.nout === claim.nout);
|
||||
}
|
||||
|
||||
// TODO: hide channels on tag pages?
|
||||
@@ -145,14 +143,10 @@ class FileListItem extends React.PureComponent {
|
||||
<View>
|
||||
{isRepost && (
|
||||
<View style={fileListStyle.repostInfo}>
|
||||
<Icon name={'retweet'} size={14} style={fileListStyle.repostIcon} />
|
||||
<Icon name={"retweet"} size={14} style={fileListStyle.repostIcon} />
|
||||
<Text style={fileListStyle.repostChannelName}>
|
||||
<Link
|
||||
text={repostChannel}
|
||||
onPress={() => navigateToUri(navigation, normalizeURI(repostChannelUrl), null, false, null, false)}
|
||||
/>{' '}
|
||||
reposted
|
||||
</Text>
|
||||
<Link text={repostChannel}
|
||||
onPress={() => navigateToUri(navigation, normalizeURI(repostChannelUrl), null, false, null, false)} /> reposted</Text>
|
||||
</View>
|
||||
)}
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import SdkLoadingStatus from './view';
|
||||
|
||||
export default connect()(SdkLoadingStatus);
|
||||
@@ -1,15 +0,0 @@
|
||||
import { ActivityIndicator, Text, View } from 'react-native';
|
||||
import React from 'react';
|
||||
import discoverStyle from 'styles/discover';
|
||||
import Colors from 'styles/colors';
|
||||
|
||||
export default class SdkLoadingStatus extends React.PureComponent {
|
||||
render() {
|
||||
return (
|
||||
<View style={discoverStyle.sdkLoading}>
|
||||
<ActivityIndicator color={Colors.White} size={'small'} />
|
||||
<Text style={discoverStyle.sdkLoadingText}>{__('The LBRY background service is initializing...')}</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -23,4 +23,7 @@ const perform = dispatch => ({
|
||||
unsubscribe: subscription => doChannelUnsubscribe(subscription),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(SuggestedSubscriptionItem);
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
)(SuggestedSubscriptionItem);
|
||||
@@ -16,4 +16,7 @@ const perform = dispatch => ({
|
||||
claimSearch: options => dispatch(doClaimSearch(options)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(SuggestedSubscriptions);
|
||||
export default connect(
|
||||
select,
|
||||
perform
|
||||
)(SuggestedSubscriptions);
|
||||
@@ -24,4 +24,7 @@ const perform = dispatch => ({
|
||||
claimSearch: options => dispatch(doClaimSearch(options)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(SuggestedSubscriptionsGrid);
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
)(SuggestedSubscriptionsGrid);
|
||||
@@ -44,9 +44,6 @@ const Constants = {
|
||||
SETTING_BACKUP_DISMISSED: 'backupDismissed',
|
||||
SETTING_REWARDS_NOT_INTERESTED: 'rewardsNotInterested',
|
||||
SETTING_DEVICE_WALLET_SYNCED: 'deviceWalletSynced',
|
||||
SETTING_DHT_ENABLED: 'dhtEnabled',
|
||||
|
||||
ACTION_SDK_READY: 'SDK_READY',
|
||||
|
||||
ACTION_DELETE_COMPLETED_BLOBS: 'DELETE_COMPLETED_BLOBS',
|
||||
ACTION_FIRST_RUN_PAGE_CHANGED: 'FIRST_RUN_PAGE_CHANGED',
|
||||
|
||||
+1
-4
@@ -55,13 +55,10 @@ import settingsReducer from 'redux/reducers/settings';
|
||||
import thunk from 'redux-thunk';
|
||||
|
||||
window.__ = __;
|
||||
if (!NativeModules.UtilityModule.dhtEnabled) {
|
||||
Lbry.alternateConnectionString = 'https://api.lbry.tv/api/v1/proxy';
|
||||
Lbry.methodsUsingAlternateConnectionString = ['claim_search', 'resolve'];
|
||||
}
|
||||
|
||||
const globalExceptionHandler = (error, isFatal) => {
|
||||
if (error && NativeModules.Firebase) {
|
||||
console.log(error);
|
||||
NativeModules.Firebase.logException(!!isFatal, error.message ? error.message : 'No message', JSON.stringify(error));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -22,7 +22,6 @@ import {
|
||||
import { doUpdateChannelFormState, doClearChannelFormState } from 'redux/actions/form';
|
||||
import { selectDrawerStack } from 'redux/selectors/drawer';
|
||||
import { selectChannelFormState, selectHasChannelFormState } from 'redux/selectors/form';
|
||||
import { selectSdkReady } from 'redux/selectors/settings';
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import ChannelCreator from './view';
|
||||
|
||||
@@ -34,7 +33,6 @@ const select = state => ({
|
||||
fetchingChannels: selectFetchingMyChannels(state),
|
||||
balance: selectBalance(state),
|
||||
hasFormState: selectHasChannelFormState(state),
|
||||
sdkReady: selectSdkReady(state),
|
||||
updatingChannel: selectUpdatingChannel(state),
|
||||
updateChannelError: selectUpdateChannelError(state),
|
||||
});
|
||||
@@ -54,4 +52,7 @@ const perform = dispatch => ({
|
||||
setExplicitNavigateBack: flag => dispatch(doSetExplicitNavigateBack(flag)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(ChannelCreator);
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
)(ChannelCreator);
|
||||
@@ -176,7 +176,9 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
NativeModules.Firebase.setCurrentScreen('Channels').then(result => {
|
||||
pushDrawerStack(Constants.DRAWER_ROUTE_CHANNEL_CREATOR, navigation.state.params ? navigation.state.params : null);
|
||||
setPlayerVisible();
|
||||
fetchChannelListMine();
|
||||
if (!fetchingChannels) {
|
||||
fetchChannelListMine();
|
||||
}
|
||||
|
||||
DeviceEventEmitter.addListener('onDocumentPickerFilePicked', this.onFilePicked);
|
||||
DeviceEventEmitter.addListener('onDocumentPickerCanceled', this.onPickerCanceled);
|
||||
@@ -800,15 +802,7 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
abandoningClaimIds,
|
||||
balance,
|
||||
fetchingChannels,
|
||||
sdkReady,
|
||||
updatingChannel,
|
||||
channels = [],
|
||||
navigation,
|
||||
} = this.props;
|
||||
const { abandoningClaimIds, balance, fetchingChannels, updatingChannel, channels = [], navigation } = this.props;
|
||||
const {
|
||||
autoStyle,
|
||||
autoStyles,
|
||||
@@ -832,19 +826,6 @@ export default class ChannelCreator extends React.PureComponent {
|
||||
|
||||
const hasChannels = channels && channels.length > 0;
|
||||
|
||||
if (!sdkReady) {
|
||||
return (
|
||||
<View style={channelCreatorStyle.container}>
|
||||
<UriBar navigation={navigation} />
|
||||
<EmptyStateView
|
||||
message={__(
|
||||
'The background service is still initializing. You can still explore and watch content during the initialization process.',
|
||||
)}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={channelCreatorStyle.container}>
|
||||
<UriBar
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
} from 'lbryinc';
|
||||
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||
import { doSetClientSetting, doSetSortByItem, doSetTimeItem } from 'redux/actions/settings';
|
||||
import { makeSelectClientSetting, selectSdkReady, selectSortByItem, selectTimeItem } from 'redux/selectors/settings';
|
||||
import { makeSelectClientSetting, selectSortByItem, selectTimeItem } from 'redux/selectors/settings';
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import DiscoverPage from './view';
|
||||
|
||||
@@ -27,7 +27,6 @@ const select = state => ({
|
||||
followedTags: selectFollowedTags(state),
|
||||
ratingReminderDisabled: makeSelectClientSetting(Constants.SETTING_RATING_REMINDER_DISABLED)(state),
|
||||
ratingReminderLastShown: makeSelectClientSetting(Constants.SETTING_RATING_REMINDER_LAST_SHOWN)(state),
|
||||
sdkReady: selectSdkReady(state),
|
||||
sortByItem: selectSortByItem(state),
|
||||
timeItem: selectTimeItem(state),
|
||||
unreadSubscriptions: selectUnreadSubscriptions(state),
|
||||
@@ -47,4 +46,7 @@ const perform = dispatch => ({
|
||||
setTimeItem: item => dispatch(doSetTimeItem(item)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(DiscoverPage);
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
)(DiscoverPage);
|
||||
@@ -23,7 +23,6 @@ import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||
import Link from 'component/link';
|
||||
import ModalTagSelector from 'component/modalTagSelector';
|
||||
import ModalPicker from 'component/modalPicker';
|
||||
import SdkLoadingStatus from 'component/sdkLoadingStatus';
|
||||
import UriBar from 'component/uriBar';
|
||||
import _ from 'lodash';
|
||||
|
||||
@@ -269,8 +268,8 @@ class DiscoverPage extends React.PureComponent {
|
||||
);
|
||||
|
||||
render() {
|
||||
const { currentRoute, navigation, sdkReady, sortByItem, timeItem } = this.props;
|
||||
const { showModalTagSelector, showSortPicker, showTimePicker } = this.state;
|
||||
const { currentRoute, navigation, sortByItem, timeItem } = this.props;
|
||||
const { orderBy, showModalTagSelector, showSortPicker, showTimePicker } = this.state;
|
||||
|
||||
return (
|
||||
<View style={discoverStyle.container}>
|
||||
@@ -290,7 +289,7 @@ class DiscoverPage extends React.PureComponent {
|
||||
keyExtractor={(item, index) => item}
|
||||
/>
|
||||
)}
|
||||
{sdkReady && !showModalTagSelector && !showSortPicker && !showTimePicker && (
|
||||
{!showModalTagSelector && !showSortPicker && !showTimePicker && (
|
||||
<FloatingWalletBalance navigation={navigation} />
|
||||
)}
|
||||
{showModalTagSelector && (
|
||||
@@ -317,8 +316,6 @@ class DiscoverPage extends React.PureComponent {
|
||||
items={Constants.CLAIM_SEARCH_TIME_ITEMS}
|
||||
/>
|
||||
)}
|
||||
|
||||
{!sdkReady && <SdkLoadingStatus />}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -11,17 +11,15 @@ import {
|
||||
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||
import { doDeleteFile } from 'redux/actions/file';
|
||||
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
||||
import { selectSdkReady } from 'redux/selectors/settings';
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import DownloadsPage from './view';
|
||||
|
||||
const select = state => ({
|
||||
claims: selectMyClaimsWithoutChannels(state),
|
||||
currentRoute: selectCurrentRoute(state),
|
||||
downloadedUris: selectDownloadedUris(state),
|
||||
fileInfos: selectFileInfosDownloaded(state),
|
||||
downloadedUris: selectDownloadedUris(state),
|
||||
fetching: selectIsFetchingFileList(state) || selectIsFetchingClaimListMine(state),
|
||||
sdkReady: selectSdkReady(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
@@ -34,4 +32,7 @@ const perform = dispatch => ({
|
||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(DownloadsPage);
|
||||
export default connect(
|
||||
select,
|
||||
perform
|
||||
)(DownloadsPage);
|
||||
@@ -144,24 +144,11 @@ class DownloadsPage extends React.PureComponent {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { downloadedUris, fetching, navigation, sdkReady } = this.props;
|
||||
const { fetching, claims, downloadedUris, fileInfos, navigation } = this.props;
|
||||
const { selectionMode, selectedUris } = this.state;
|
||||
const filteredUris = this.getFilteredUris();
|
||||
const hasDownloads = filteredUris && filteredUris.length > 0;
|
||||
|
||||
if (!sdkReady) {
|
||||
return (
|
||||
<View style={downloadsStyle.container}>
|
||||
<UriBar navigation={navigation} />
|
||||
<EmptyStateView
|
||||
message={__(
|
||||
'The background service is still initializing. You can still explore and watch content during the initialization process.',
|
||||
)}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={downloadsStyle.container}>
|
||||
<UriBar
|
||||
|
||||
@@ -41,7 +41,6 @@ import { doDeleteFile, doStopDownloadingFile } from 'redux/actions/file';
|
||||
import { doPushDrawerStack, doPopDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||
import { doToggleFullscreenMode } from 'redux/actions/settings';
|
||||
import { selectDrawerStack, makeSelectPlayerVisible } from 'redux/selectors/drawer';
|
||||
import { selectSdkReady } from 'redux/selectors/settings';
|
||||
import FilePage from './view';
|
||||
|
||||
const select = (state, props) => {
|
||||
@@ -67,7 +66,6 @@ const select = (state, props) => {
|
||||
failedPurchaseUris: selectFailedPurchaseUris(state),
|
||||
myClaimUris: selectMyClaimUrisWithoutChannels(state),
|
||||
purchaseUriErrorMessage: selectPurchaseUriErrorMessage(state),
|
||||
sdkReady: selectSdkReady(state),
|
||||
streamingUrl: makeSelectStreamingUrlForUri(contentUri)(state),
|
||||
thumbnail: makeSelectThumbnailForUri(contentUri)(state),
|
||||
title: makeSelectTitleForUri(contentUri)(state),
|
||||
@@ -101,4 +99,7 @@ const perform = dispatch => ({
|
||||
toggleFullscreenMode: mode => dispatch(doToggleFullscreenMode(mode)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(FilePage);
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
)(FilePage);
|
||||
+10
-44
@@ -43,6 +43,7 @@ import RelatedContent from 'component/relatedContent';
|
||||
import SubscribeButton from 'component/subscribeButton';
|
||||
import SubscribeNotificationButton from 'component/subscribeNotificationButton';
|
||||
import UriBar from 'component/uriBar';
|
||||
import Video from 'react-native-video';
|
||||
import FileRewardsDriver from 'component/fileRewardsDriver';
|
||||
import filePageStyle from 'styles/filePage';
|
||||
import uriBarStyle from 'styles/uriBar';
|
||||
@@ -72,7 +73,7 @@ class FilePage extends React.PureComponent {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
autoGetAttempted: false,
|
||||
attemptAutoGet: false,
|
||||
autoOpened: false,
|
||||
autoDownloadStarted: false,
|
||||
autoPlayMedia: false,
|
||||
@@ -296,17 +297,7 @@ class FilePage extends React.PureComponent {
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps, prevState) {
|
||||
const {
|
||||
claim,
|
||||
contentType,
|
||||
costInfo,
|
||||
fileInfo,
|
||||
isResolvingUri,
|
||||
resolveUri,
|
||||
sdkReady,
|
||||
navigation,
|
||||
title,
|
||||
} = this.props;
|
||||
const { claim, contentType, costInfo, fileInfo, isResolvingUri, resolveUri, navigation, title } = this.props;
|
||||
const { uri } = this.state;
|
||||
if (!isResolvingUri && claim === undefined && uri) {
|
||||
resolveUri(uri);
|
||||
@@ -332,12 +323,10 @@ class FilePage extends React.PureComponent {
|
||||
const isPlayable = mediaType === 'video' || mediaType === 'audio';
|
||||
const isViewable = mediaType === 'image' || mediaType === 'text';
|
||||
if (claim && costInfo && costInfo.cost === 0 && !this.state.autoGetAttempted && isViewable) {
|
||||
this.setState({ autoGetAttempted: true }, () => {
|
||||
this.checkStoragePermissionForDownload();
|
||||
});
|
||||
this.setState({ autoGetAttempted: true }, () => this.checkStoragePermissionForDownload());
|
||||
}
|
||||
|
||||
if (((costInfo && costInfo.cost > 0) || !isPlayable) && !fileInfo && !isViewable && !this.state.showRecommended) {
|
||||
if (((costInfo && costInfo.cost > 0) || !isPlayable) && (!fileInfo && !isViewable) && !this.state.showRecommended) {
|
||||
this.setState({ showRecommended: true });
|
||||
}
|
||||
|
||||
@@ -717,7 +706,7 @@ class FilePage extends React.PureComponent {
|
||||
};
|
||||
|
||||
confirmPurchaseUri = (uri, costInfo, download) => {
|
||||
const { notify, purchaseUri, sdkReady, title } = this.props;
|
||||
const { notify, purchaseUri, title } = this.props;
|
||||
if (!costInfo) {
|
||||
notify({ message: __('This content cannot be viewed at this time. Please try again in a bit.'), isError: true });
|
||||
this.setState({ downloadPressed: false });
|
||||
@@ -726,11 +715,6 @@ class FilePage extends React.PureComponent {
|
||||
}
|
||||
|
||||
const { cost } = costInfo;
|
||||
if (!NativeModules.UtilityModule.dhtEnabled && !sdkReady && parseFloat(cost) === 0) {
|
||||
this.attemptLbryTvPlayback();
|
||||
return;
|
||||
}
|
||||
|
||||
if (costInfo.cost > 0) {
|
||||
Alert.alert(
|
||||
__('Confirm Purchase'),
|
||||
@@ -758,40 +742,22 @@ class FilePage extends React.PureComponent {
|
||||
}
|
||||
};
|
||||
|
||||
getStreamUrlForClaim = claim => {
|
||||
const { name, claim_id: claimId } = claim;
|
||||
return `https://player.lbry.tv/content/claims/${name}/${claimId}/stream`;
|
||||
};
|
||||
|
||||
attemptLbryTvPlayback = () => {
|
||||
const { claim } = this.props;
|
||||
if (claim) {
|
||||
this.setState({ streamingMode: true, currentStreamUrl: this.getStreamUrlForClaim(claim) });
|
||||
}
|
||||
};
|
||||
|
||||
onFileDownloadButtonPressed = () => {
|
||||
this.startTime = Date.now();
|
||||
const { claim, costInfo, contentType, notify, sdkReady, setPlayerVisible } = this.props;
|
||||
const { claim, costInfo, contentType, setPlayerVisible } = this.props;
|
||||
const mediaType = Lbry.getMediaType(contentType);
|
||||
const isPlayable = mediaType === 'video' || mediaType === 'audio';
|
||||
const isViewable = mediaType === 'image' || mediaType === 'text';
|
||||
|
||||
const purchaseUrl = this.getPurchaseUrl();
|
||||
NativeModules.Firebase.track('purchase_uri', { uri: purchaseUrl });
|
||||
|
||||
if (!isPlayable) {
|
||||
if (!sdkReady) {
|
||||
notify({
|
||||
message: __('The LBRY background service is still initializing. Please wait a few moments and try again.'),
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.onDownloadPressed();
|
||||
} else {
|
||||
this.confirmPurchaseUri(purchaseUrl, costInfo, !isPlayable);
|
||||
}
|
||||
|
||||
NativeModules.Firebase.track('purchase_uri', { uri: purchaseUrl });
|
||||
|
||||
if (isPlayable) {
|
||||
this.setState({ downloadPressed: true, autoPlayMedia: true, stopDownloadConfirmed: false });
|
||||
}
|
||||
@@ -1211,7 +1177,7 @@ class FilePage extends React.PureComponent {
|
||||
style={filePageStyle.mediaContainer}
|
||||
onPress={this.onFileDownloadButtonPressed}
|
||||
>
|
||||
{(canOpen || !fileInfo || (isPlayable && !canLoadMedia) || (!canOpen && fileInfo)) && (
|
||||
{(canOpen || (!fileInfo || (isPlayable && !canLoadMedia)) || (!canOpen && fileInfo)) && (
|
||||
<FileItemMedia
|
||||
duration={duration}
|
||||
style={filePageStyle.thumbnail}
|
||||
|
||||
@@ -12,22 +12,23 @@ import {
|
||||
doFetchInviteStatus,
|
||||
doUserInviteNew,
|
||||
} from 'lbryinc';
|
||||
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||
import { selectSdkReady } from 'redux/selectors/settings';
|
||||
import { doPushDrawerStack, doPopDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||
import { doUpdateChannelFormState, doClearChannelFormState } from 'redux/actions/form';
|
||||
import { selectDrawerStack } from 'redux/selectors/drawer';
|
||||
import { selectChannelFormState, selectHasChannelFormState } from 'redux/selectors/form';
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import InvitesPage from './view';
|
||||
|
||||
const select = state => ({
|
||||
channels: selectMyChannelClaims(state),
|
||||
errorMessage: selectUserInviteNewErrorMessage(state),
|
||||
fetchingChannels: selectFetchingMyChannels(state),
|
||||
fetchingInvitees: selectUserInviteStatusIsPending(state),
|
||||
invitees: selectUserInvitees(state),
|
||||
errorMessage: selectUserInviteNewErrorMessage(state),
|
||||
invitesRemaining: selectUserInvitesRemaining(state),
|
||||
isPending: selectUserInviteNewIsPending(state),
|
||||
referralCode: selectUserInviteReferralCode(state),
|
||||
isPending: selectUserInviteNewIsPending(state),
|
||||
invitees: selectUserInvitees(state),
|
||||
referralReward: selectReferralReward(state),
|
||||
sdkReady: selectSdkReady(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
@@ -39,4 +40,7 @@ const perform = dispatch => ({
|
||||
notify: data => dispatch(doToast(data)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(InvitesPage);
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
)(InvitesPage);
|
||||
@@ -11,10 +11,14 @@ import {
|
||||
View,
|
||||
} from 'react-native';
|
||||
import Colors from 'styles/colors';
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||
import Link from 'component/link';
|
||||
import Button from 'component/button';
|
||||
import ChannelSelector from 'component/channelSelector';
|
||||
import EmptyStateView from 'component/emptyStateView';
|
||||
import PageHeader from 'component/pageHeader';
|
||||
import RewardCard from 'component/rewardCard';
|
||||
import RewardEnrolment from 'component/rewardEnrolment';
|
||||
import UriBar from 'component/uriBar';
|
||||
import invitesStyle from 'styles/invites';
|
||||
import { fetchReferralCode, logPublish } from 'utils/helper';
|
||||
@@ -130,23 +134,10 @@ class InvitesPage extends React.PureComponent {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { fetchingInvitees, invitees, isPending, navigation, sdkReady } = this.props;
|
||||
const { email } = this.state;
|
||||
const { fetchingInvitees, user, navigation, notify, isPending, invitees } = this.props;
|
||||
const { email, inviteLink } = this.state;
|
||||
const hasInvitees = invitees && invitees.length > 0;
|
||||
|
||||
if (!sdkReady) {
|
||||
return (
|
||||
<View style={invitesStyle.container}>
|
||||
<UriBar navigation={navigation} />
|
||||
<EmptyStateView
|
||||
message={__(
|
||||
'The background service is still initializing. You can still explore and watch content during the initialization process.',
|
||||
)}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={invitesStyle.container}>
|
||||
<UriBar navigation={navigation} />
|
||||
|
||||
@@ -25,4 +25,7 @@ const perform = dispatch => ({
|
||||
toggleFullscreenMode: mode => dispatch(doToggleFullscreenMode(mode)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(LiteFilePage);
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
)(LiteFilePage);
|
||||
@@ -13,7 +13,6 @@ import { selectDrawerStack } from 'redux/selectors/drawer';
|
||||
import { doUpdatePublishFormState, doClearPublishFormState, doPendingPublishSuccess } from 'redux/actions/form';
|
||||
import { doPushDrawerStack, doPopDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||
import { selectPublishFormState, selectHasPublishFormState } from 'redux/selectors/form';
|
||||
import { selectSdkReady } from 'redux/selectors/settings';
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import PublishPage from './view';
|
||||
|
||||
@@ -24,7 +23,6 @@ const select = state => ({
|
||||
myClaims: selectMyClaims(state),
|
||||
publishFormState: selectPublishFormState(state),
|
||||
publishFormValues: selectPublishFormValues(state),
|
||||
sdkReady: selectSdkReady(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
@@ -41,4 +39,7 @@ const perform = dispatch => ({
|
||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(PublishPage);
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
)(PublishPage);
|
||||
@@ -37,7 +37,6 @@ import Button from 'component/button';
|
||||
import ChannelSelector from 'component/channelSelector';
|
||||
import Colors from 'styles/colors';
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import EmptyStateView from 'component/emptyStateView';
|
||||
import FastImage from 'react-native-fast-image';
|
||||
import FloatingWalletBalance from 'component/floatingWalletBalance';
|
||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||
@@ -975,7 +974,7 @@ class PublishPage extends React.PureComponent {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { balance, navigation, notify, sdkReady } = this.props;
|
||||
const { balance, navigation, notify, publishFormValues } = this.props;
|
||||
const {
|
||||
allThumbnailsChecked,
|
||||
canUseCamera,
|
||||
@@ -988,19 +987,6 @@ class PublishPage extends React.PureComponent {
|
||||
videos,
|
||||
} = this.state;
|
||||
|
||||
if (!sdkReady) {
|
||||
return (
|
||||
<View style={publishStyle.container}>
|
||||
<UriBar navigation={navigation} />
|
||||
<EmptyStateView
|
||||
message={__(
|
||||
'The background service is still initializing. You can still explore and watch content during the initialization process.',
|
||||
)}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
let content;
|
||||
if (Constants.PHASE_SELECTOR === currentPhase) {
|
||||
content = (
|
||||
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
selectIsFetchingClaimListMine,
|
||||
} from 'lbry-redux';
|
||||
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||
import { selectSdkReady } from 'redux/selectors/settings';
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import PublishesPage from './view';
|
||||
|
||||
@@ -17,7 +16,6 @@ const select = state => ({
|
||||
uris: selectMyClaimUrisWithoutChannels(state),
|
||||
fetching: selectIsFetchingClaimListMine(state),
|
||||
pendingClaims: selectPendingClaims(state),
|
||||
sdkReady: selectSdkReady(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
@@ -29,4 +27,7 @@ const perform = dispatch => ({
|
||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(PublishesPage);
|
||||
export default connect(
|
||||
select,
|
||||
perform
|
||||
)(PublishesPage);
|
||||
@@ -114,27 +114,14 @@ class PublishesPage extends React.PureComponent {
|
||||
},
|
||||
},
|
||||
],
|
||||
{ cancelable: true },
|
||||
{ cancelable: true }
|
||||
);
|
||||
};
|
||||
|
||||
render() {
|
||||
const { fetching, navigation, sdkReady, uris } = this.props;
|
||||
const { fetching, navigation, uris } = this.props;
|
||||
const { selectionMode, selectedUris } = this.state;
|
||||
|
||||
if (!sdkReady) {
|
||||
return (
|
||||
<View style={publishStyle.container}>
|
||||
<UriBar navigation={navigation} />
|
||||
<EmptyStateView
|
||||
message={__(
|
||||
'The background service is still initializing. You can still explore and watch content during the initialization process.',
|
||||
)}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={publishStyle.container}>
|
||||
<UriBar
|
||||
|
||||
@@ -12,8 +12,7 @@ import {
|
||||
import { doToast } from 'lbry-redux';
|
||||
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
||||
import { selectSdkReady } from 'redux/selectors/settings';
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import Constants from 'constants';
|
||||
import RewardsPage from './view';
|
||||
|
||||
const select = state => ({
|
||||
@@ -23,7 +22,6 @@ const select = state => ({
|
||||
emailVerifyPending: selectEmailVerifyIsPending(state),
|
||||
fetching: selectFetchingRewards(state),
|
||||
rewards: selectUnclaimedRewards(state),
|
||||
sdkReady: selectSdkReady(state),
|
||||
user: selectUser(state),
|
||||
});
|
||||
|
||||
@@ -35,4 +33,7 @@ const perform = dispatch => ({
|
||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(RewardsPage);
|
||||
export default connect(
|
||||
select,
|
||||
perform
|
||||
)(RewardsPage);
|
||||
@@ -5,7 +5,7 @@ import Colors from 'styles/colors';
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import Link from 'component/link';
|
||||
import CustomRewardCard from 'component/customRewardCard';
|
||||
import EmptyStateView from 'component/emptyStateView';
|
||||
import PageHeader from 'component/pageHeader';
|
||||
import RewardCard from 'component/rewardCard';
|
||||
import RewardEnrolment from 'component/rewardEnrolment';
|
||||
import UriBar from 'component/uriBar';
|
||||
@@ -192,22 +192,9 @@ class RewardsPage extends React.PureComponent {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { navigation, sdkReady } = this.props;
|
||||
const { user, navigation } = this.props;
|
||||
const { currentFilter } = this.state;
|
||||
|
||||
if (!sdkReady) {
|
||||
return (
|
||||
<View style={rewardStyle.container}>
|
||||
<UriBar navigation={navigation} />
|
||||
<EmptyStateView
|
||||
message={__(
|
||||
'The background service is still initializing. You can still explore and watch content during the initialization process.',
|
||||
)}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={rewardStyle.container}>
|
||||
<UriBar navigation={navigation} />
|
||||
|
||||
@@ -11,7 +11,6 @@ const select = state => ({
|
||||
backgroundPlayEnabled: makeSelectClientSetting(SETTINGS.BACKGROUND_PLAY_ENABLED)(state),
|
||||
currentRoute: selectCurrentRoute(state),
|
||||
drawerStack: selectDrawerStack(state),
|
||||
enableDht: makeSelectClientSetting(Constants.SETTING_DHT_ENABLED)(state),
|
||||
keepDaemonRunning: makeSelectClientSetting(SETTINGS.KEEP_DAEMON_RUNNING)(state),
|
||||
language: makeSelectClientSetting(SETTINGS.LANGUAGE)(state),
|
||||
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_NSFW)(state),
|
||||
@@ -30,4 +29,7 @@ const perform = dispatch => ({
|
||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(SettingsPage);
|
||||
export default connect(
|
||||
select,
|
||||
perform
|
||||
)(SettingsPage);
|
||||
@@ -1,16 +1,6 @@
|
||||
import React from 'react';
|
||||
import { SETTINGS } from 'lbry-redux';
|
||||
import {
|
||||
ActivityIndicator,
|
||||
Picker,
|
||||
Platform,
|
||||
Text,
|
||||
TextInput,
|
||||
View,
|
||||
ScrollView,
|
||||
Switch,
|
||||
NativeModules,
|
||||
} from 'react-native';
|
||||
import { ActivityIndicator, Picker, Platform, Text, View, ScrollView, Switch, NativeModules } from 'react-native';
|
||||
import { navigateBack } from 'utils/helper';
|
||||
import AsyncStorage from '@react-native-community/async-storage';
|
||||
import Colors from 'styles/colors';
|
||||
@@ -21,27 +11,16 @@ import settingsStyle from 'styles/settings';
|
||||
|
||||
const languageOptions = [
|
||||
{ code: 'default', name: 'Use device language' },
|
||||
{ code: 'jv', name: 'Basa Jawa' },
|
||||
{ code: 'da', name: 'Danish' },
|
||||
{ code: 'nl', name: 'Dutch' },
|
||||
{ code: 'en', name: 'English' },
|
||||
{ code: 'et', name: 'Estonian' },
|
||||
{ code: 'fr', name: 'French' },
|
||||
{ code: 'gu', name: 'Gujarati' },
|
||||
{ code: 'hi', name: 'Hindi' },
|
||||
{ code: 'id', name: 'Indonesian' },
|
||||
{ code: 'it', name: 'Italian' },
|
||||
{ code: 'kn', name: 'Kannada' },
|
||||
{ code: 'ms', name: 'Malay' },
|
||||
{ code: 'mr', name: 'Marathi' },
|
||||
{ code: 'tr', name: 'Turkish' },
|
||||
{ code: 'pl', name: 'Polish' },
|
||||
{ code: 'pt', name: 'Portuguese' },
|
||||
{ code: 'ro', name: 'Romanian' },
|
||||
{ code: 'ru', name: 'Russian' },
|
||||
{ code: 'sk', name: 'Slovak' },
|
||||
{ code: 'es', name: 'Spanish' },
|
||||
{ code: 'tr', name: 'Turkish' },
|
||||
{ code: 'uk', name: 'Ukrainian' },
|
||||
];
|
||||
|
||||
class SettingsPage extends React.PureComponent {
|
||||
@@ -161,7 +140,6 @@ class SettingsPage extends React.PureComponent {
|
||||
render() {
|
||||
const {
|
||||
backgroundPlayEnabled,
|
||||
enableDht,
|
||||
keepDaemonRunning,
|
||||
receiveSubscriptionNotifications,
|
||||
receiveRewardNotifications,
|
||||
@@ -179,7 +157,6 @@ class SettingsPage extends React.PureComponent {
|
||||
const actualReceiveRewardNotifications = this.getBooleanSetting(receiveRewardNotifications, true);
|
||||
const actualReceiveInterestsNotifications = this.getBooleanSetting(receiveInterestsNotifications, true);
|
||||
const actualReceiveCreatorNotifications = this.getBooleanSetting(receiveCreatorNotifications, true);
|
||||
const actualEnableDht = this.getBooleanSetting(enableDht, false);
|
||||
|
||||
return (
|
||||
<View style={settingsStyle.container}>
|
||||
@@ -317,7 +294,7 @@ class SettingsPage extends React.PureComponent {
|
||||
</Text>
|
||||
<Text style={settingsStyle.description}>
|
||||
{__(
|
||||
'Enable this option for quicker app launch and to keep the synchronisation with the blockchain up to date.',
|
||||
'Enable this option for quicker app launch and to keep the synchronisation with the blockchain up to date.'
|
||||
)}
|
||||
</Text>
|
||||
</View>
|
||||
@@ -333,25 +310,6 @@ class SettingsPage extends React.PureComponent {
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<View style={settingsStyle.row}>
|
||||
<View style={settingsStyle.switchText}>
|
||||
<Text style={settingsStyle.label}>{__('Participate in the data network')}</Text>
|
||||
<Text style={settingsStyle.description}>
|
||||
{__(
|
||||
'Enable peer-to-peer functionality (this will take effect upon app and background service restart)',
|
||||
)}
|
||||
</Text>
|
||||
</View>
|
||||
<View style={settingsStyle.switchContainer}>
|
||||
<Switch
|
||||
value={actualEnableDht}
|
||||
onValueChange={value => {
|
||||
this.setNativeBooleanSetting(Constants.SETTING_DHT_ENABLED, value);
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
</ScrollView>
|
||||
</View>
|
||||
);
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { SETTINGS, doUpdateBlockHeight, doPopulateSharedUserState, doToast } from 'lbry-redux';
|
||||
import { SETTINGS, doBalanceSubscribe, doUpdateBlockHeight, doPopulateSharedUserState, doToast } from 'lbry-redux';
|
||||
import {
|
||||
doAuthenticate,
|
||||
doInstallNew,
|
||||
doInstallNewWithParams,
|
||||
doBlackListedOutpointsSubscribe,
|
||||
doFilteredOutpointsSubscribe,
|
||||
doFetchMySubscriptions,
|
||||
doFetchRewardedContent,
|
||||
doGetSync,
|
||||
@@ -25,10 +28,12 @@ const select = state => ({
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
authenticate: (appVersion, os, firebaseToken, callInstall) =>
|
||||
dispatch(doAuthenticate(appVersion, os, firebaseToken, true, null, callInstall)),
|
||||
authenticate: (appVersion, os, firebaseToken) => dispatch(doAuthenticate(appVersion, os, firebaseToken)),
|
||||
installNewWithParams: (appVersion, installationId, nodeId, lbrynetVersion, os, platform, firebaseToken) =>
|
||||
dispatch(doInstallNewWithParams(appVersion, installationId, nodeId, lbrynetVersion, os, platform, firebaseToken)),
|
||||
balanceSubscribe: () => dispatch(doBalanceSubscribe()),
|
||||
blacklistedOutpointsSubscribe: () => dispatch(doBlackListedOutpointsSubscribe()),
|
||||
filteredOutpointsSubscribe: () => dispatch(doFilteredOutpointsSubscribe()),
|
||||
fetchRewardedContent: () => dispatch(doFetchRewardedContent()),
|
||||
fetchSubscriptions: callback => dispatch(doFetchMySubscriptions(callback)),
|
||||
getSync: (password, callback) => dispatch(doGetSync(password, callback)),
|
||||
|
||||
+104
-89
@@ -23,7 +23,6 @@ class SplashScreen extends React.PureComponent {
|
||||
};
|
||||
|
||||
state = {
|
||||
authWithoutSdk: false,
|
||||
accountUnlockFailed: false,
|
||||
appVersion: null,
|
||||
daemonReady: false,
|
||||
@@ -54,7 +53,7 @@ class SplashScreen extends React.PureComponent {
|
||||
liteModeParams: {
|
||||
installationId: installIdContent,
|
||||
nodeId: null,
|
||||
lbrynetVersion: '0.64.0',
|
||||
lbrynetVersion: '0.62.0',
|
||||
platform,
|
||||
},
|
||||
},
|
||||
@@ -67,26 +66,26 @@ class SplashScreen extends React.PureComponent {
|
||||
});
|
||||
};
|
||||
|
||||
authenticateWithoutSdk() {
|
||||
const { authenticate } = this.props;
|
||||
NativeModules.VersionInfo.getAppVersion().then(appVersion => {
|
||||
this.setState({ appVersion, shouldAuthenticate: true, authWithoutSdk: true });
|
||||
NativeModules.Firebase.getMessagingToken()
|
||||
.then(firebaseToken => {
|
||||
this.setState({ firebaseToken }, () => authenticate(appVersion, Platform.OS, firebaseToken, false));
|
||||
})
|
||||
.catch(() => {
|
||||
authenticate(appVersion, Platform.OS, null, false);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
updateStatus() {
|
||||
const { authenticate } = this.props;
|
||||
const { liteMode } = this.state;
|
||||
|
||||
// authenticate immediately
|
||||
if (!NativeModules.UtilityModule.dhtEnabled) {
|
||||
this.authenticateWithoutSdk();
|
||||
if (liteMode) {
|
||||
// authenticate immediately
|
||||
NativeModules.VersionInfo.getAppVersion().then(appVersion => {
|
||||
this.setState({ appVersion, shouldAuthenticate: true });
|
||||
NativeModules.Firebase.getMessagingToken()
|
||||
.then(firebaseToken => {
|
||||
this.setState({ firebaseToken }, () => authenticate(appVersion, Platform.OS, firebaseToken, false));
|
||||
})
|
||||
.catch(() => {
|
||||
authenticate(appVersion, Platform.OS, null, false);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
Lbry.status().then(status => {
|
||||
this._updateStatusCallback(status);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,50 +121,40 @@ class SplashScreen extends React.PureComponent {
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
const { getSync, installNewWithParams } = this.props;
|
||||
const {
|
||||
daemonReady,
|
||||
authWithoutSdk,
|
||||
shouldAuthenticate,
|
||||
liteMode,
|
||||
liteModeParams,
|
||||
appVersion,
|
||||
firebaseToken,
|
||||
} = this.state;
|
||||
const { daemonReady, shouldAuthenticate, liteMode, liteModeParams, appVersion, firebaseToken } = this.state;
|
||||
const { user } = nextProps;
|
||||
|
||||
if (liteMode && user && user.id) {
|
||||
this.navigateToLiteMode();
|
||||
} else if (shouldAuthenticate && user && user.id) {
|
||||
if (daemonReady || authWithoutSdk) {
|
||||
this.setState({ shouldAuthenticate: false }, () => {
|
||||
// call install new after successful authentication
|
||||
if (authWithoutSdk) {
|
||||
const { installationId, nodeId, lbrynetVersion, platform } = liteModeParams;
|
||||
installNewWithParams(
|
||||
appVersion,
|
||||
installationId,
|
||||
nodeId,
|
||||
lbrynetVersion,
|
||||
Platform.OS,
|
||||
platform,
|
||||
firebaseToken,
|
||||
);
|
||||
}
|
||||
} else if (daemonReady && shouldAuthenticate && user && user.id) {
|
||||
this.setState({ shouldAuthenticate: false }, () => {
|
||||
// call install new after successful authentication
|
||||
if (liteMode) {
|
||||
const { installationId, nodeId, lbrynetVersion, platform } = liteModeParams;
|
||||
installNewWithParams(
|
||||
appVersion,
|
||||
installationId,
|
||||
nodeId,
|
||||
lbrynetVersion,
|
||||
Platform.OS,
|
||||
platform,
|
||||
firebaseToken,
|
||||
);
|
||||
}
|
||||
|
||||
// user is authenticated, navigate to the main view
|
||||
if (user.has_verified_email) {
|
||||
NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(walletPassword => {
|
||||
getSync(walletPassword, () => {
|
||||
this.getUserSettings();
|
||||
});
|
||||
// user is authenticated, navigate to the main view
|
||||
if (user.has_verified_email) {
|
||||
NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(walletPassword => {
|
||||
getSync(walletPassword, () => {
|
||||
this.getUserSettings();
|
||||
});
|
||||
this.navigateToMain();
|
||||
return;
|
||||
}
|
||||
|
||||
});
|
||||
this.navigateToMain();
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
this.navigateToMain();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,9 +194,22 @@ class SplashScreen extends React.PureComponent {
|
||||
};
|
||||
|
||||
finishSplashScreen = () => {
|
||||
const { authenticate, getSync, user } = this.props;
|
||||
const {
|
||||
authenticate,
|
||||
balanceSubscribe,
|
||||
blacklistedOutpointsSubscribe,
|
||||
filteredOutpointsSubscribe,
|
||||
getSync,
|
||||
updateBlockHeight,
|
||||
user,
|
||||
} = this.props;
|
||||
|
||||
// Lbry.resolve({ urls: 'lbry://one' }).then(() => {
|
||||
// Leave the splash screen
|
||||
balanceSubscribe();
|
||||
blacklistedOutpointsSubscribe();
|
||||
filteredOutpointsSubscribe();
|
||||
|
||||
if (user && user.id && user.has_verified_email) {
|
||||
// user already authenticated
|
||||
NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(walletPassword => {
|
||||
@@ -221,20 +223,37 @@ class SplashScreen extends React.PureComponent {
|
||||
this.setState({ shouldAuthenticate: true }, () => {
|
||||
NativeModules.Firebase.getMessagingToken()
|
||||
.then(firebaseToken => {
|
||||
authenticate(appVersion, Platform.OS, firebaseToken, true);
|
||||
authenticate(appVersion, Platform.OS, firebaseToken);
|
||||
})
|
||||
.catch(() => authenticate(appVersion, Platform.OS, null, true));
|
||||
.catch(() => authenticate(appVersion, Platform.OS));
|
||||
});
|
||||
});
|
||||
}
|
||||
// });
|
||||
};
|
||||
|
||||
handleAccountUnlockFailed() {
|
||||
this.setState({ accountUnlockFailed: true });
|
||||
}
|
||||
|
||||
handleSdkReady = () => {
|
||||
this.setState({ daemonReady: true }, () => {
|
||||
_updateStatusCallback(status) {
|
||||
const { fetchSubscriptions, getSync, setClientSetting } = this.props;
|
||||
const startupStatus = status.startup_status;
|
||||
const walletStatus = status.wallet;
|
||||
|
||||
// At the minimum, wallet should be started and blocks_behind equal to 0 before calling resolve
|
||||
const hasStarted = startupStatus.stream_manager && startupStatus.wallet && status.wallet.blocks_behind <= 0;
|
||||
if (hasStarted) {
|
||||
// Wait until we are able to resolve a name before declaring
|
||||
// that we are done.
|
||||
// TODO: This is a hack, and the logic should live in the daemon
|
||||
// to give us a better sense of when we are actually started
|
||||
this.setState({
|
||||
daemonReady: true,
|
||||
isLagging: false,
|
||||
isRunning: true,
|
||||
});
|
||||
|
||||
Lbry.wallet_status().then(secureWalletStatus => {
|
||||
// For now, automatically unlock the wallet if a password is set so that downloads work
|
||||
NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(password => {
|
||||
@@ -265,12 +284,9 @@ class SplashScreen extends React.PureComponent {
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
handleSdkStatusResponse = evt => {
|
||||
const { status } = evt;
|
||||
const walletStatus = status.wallet;
|
||||
return;
|
||||
}
|
||||
|
||||
const headerSyncProgress = walletStatus ? walletStatus.headers_synchronization_progress : null;
|
||||
if (headerSyncProgress && headerSyncProgress < 100) {
|
||||
@@ -305,24 +321,23 @@ class SplashScreen extends React.PureComponent {
|
||||
details: __('Initializing LBRY service'),
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
setTimeout(() => {
|
||||
this.updateStatus();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
DeviceEventEmitter.addListener('onNotificationTargetLaunch', this.onNotificationTargetLaunch);
|
||||
DeviceEventEmitter.addListener('onSdkReady', this.handleSdkReady);
|
||||
DeviceEventEmitter.addListener('onSdkStatusResponse', this.handleSdkStatusResponse);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
DeviceEventEmitter.removeListener('onNotificationTargetLaunch', this.onNotificationTargetLaunch);
|
||||
DeviceEventEmitter.removeListener('onSdkReady', this.handleSdkReady);
|
||||
DeviceEventEmitter.removeListener('onSdkStatusResponse', this.handleSdkStatusResponse);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
NativeModules.Firebase.track('app_launch', null);
|
||||
NativeModules.Firebase.setCurrentScreen('Splash');
|
||||
|
||||
const { navigation } = this.props;
|
||||
const { resetUrl } = navigation.state.params;
|
||||
const isResetUrlSet = !!resetUrl;
|
||||
@@ -342,7 +357,11 @@ class SplashScreen extends React.PureComponent {
|
||||
}
|
||||
|
||||
// Only connect after checking initial launch url / notification launch target
|
||||
this.initLiteMode();
|
||||
if (liteMode) {
|
||||
this.initLiteMode();
|
||||
} else {
|
||||
this.lbryConnect();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -358,23 +377,19 @@ class SplashScreen extends React.PureComponent {
|
||||
}
|
||||
|
||||
lbryConnect = () => {
|
||||
if (NativeModules.UtilityModule.dhtEnabled) {
|
||||
Lbry.connect()
|
||||
.then(() => {
|
||||
this.updateStatus();
|
||||
})
|
||||
.catch(e => {
|
||||
this.setState({
|
||||
isLagging: true,
|
||||
message: __('Connection Failure'),
|
||||
details: __(
|
||||
'We could not establish a connection to the SDK. Your data connection may be preventing LBRY from connecting. Contact hello@lbry.com if you think this is a software bug.',
|
||||
),
|
||||
});
|
||||
Lbry.connect()
|
||||
.then(() => {
|
||||
this.updateStatus();
|
||||
})
|
||||
.catch(e => {
|
||||
this.setState({
|
||||
isLagging: true,
|
||||
message: __('Connection Failure'),
|
||||
details: __(
|
||||
'We could not establish a connection to the SDK. Your data connection may be preventing LBRY from connecting. Contact hello@lbry.com if you think this is a software bug.',
|
||||
),
|
||||
});
|
||||
} else {
|
||||
this.updateStatus(); // skip lbry.connect for now (unless dht flag is enabled)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
handleContinueAnywayPressed = () => {
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
import { doToast, selectFetchingClaimSearch } from 'lbry-redux';
|
||||
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||
import { doSetClientSetting, doSetTimeItem } from 'redux/actions/settings';
|
||||
import { makeSelectClientSetting, selectSdkReady, selectTimeItem } from 'redux/selectors/settings';
|
||||
import { makeSelectClientSetting, selectTimeItem } from 'redux/selectors/settings';
|
||||
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import SubscriptionsPage from './view';
|
||||
@@ -34,7 +34,6 @@ const select = state => ({
|
||||
firstRunCompleted: selectFirstRunCompleted(state),
|
||||
showSuggestedSubs: selectShowSuggestedSubs(state),
|
||||
timeItem: selectTimeItem(state),
|
||||
sdkReady: selectSdkReady(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
@@ -49,4 +48,7 @@ const perform = dispatch => ({
|
||||
setTimeItem: item => dispatch(doSetTimeItem(item)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(SubscriptionsPage);
|
||||
export default connect(
|
||||
select,
|
||||
perform,
|
||||
)(SubscriptionsPage);
|
||||
@@ -30,7 +30,6 @@ import SubscribedChannelList from 'component/subscribedChannelList';
|
||||
import SuggestedSubscriptions from 'component/suggestedSubscriptions';
|
||||
import SuggestedSubscriptionsGrid from 'component/suggestedSubscriptionsGrid';
|
||||
import UriBar from 'component/uriBar';
|
||||
import SdkLoadingStatus from 'component/sdkLoadingStatus';
|
||||
|
||||
class SubscriptionsPage extends React.PureComponent {
|
||||
state = {
|
||||
@@ -138,7 +137,21 @@ class SubscriptionsPage extends React.PureComponent {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { subscribedChannels, loading, loadingSuggested, sdkReady, timeItem, navigation, notify } = this.props;
|
||||
const {
|
||||
suggestedChannels,
|
||||
subscribedChannels,
|
||||
allSubscriptions,
|
||||
doCompleteFirstRun,
|
||||
doShowSuggestedSubs,
|
||||
loading,
|
||||
loadingSuggested,
|
||||
firstRunCompleted,
|
||||
showSuggestedSubs,
|
||||
timeItem,
|
||||
unreadSubscriptions,
|
||||
navigation,
|
||||
notify,
|
||||
} = this.props;
|
||||
const { currentSortByItem, filteredChannels, showModalSuggestedSubs, showSortPicker, showTimePicker } = this.state;
|
||||
|
||||
const numberOfSubscriptions = subscribedChannels ? subscribedChannels.length : 0;
|
||||
@@ -283,8 +296,6 @@ class SubscriptionsPage extends React.PureComponent {
|
||||
onDonePress={() => this.setState({ showModalSuggestedSubs: false })}
|
||||
/>
|
||||
)}
|
||||
|
||||
{!sdkReady && <SdkLoadingStatus />}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,12 +3,11 @@ import { selectFollowedTags, doToggleTagFollow } from 'lbry-redux';
|
||||
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||
import { doSetSortByItem, doSetTimeItem } from 'redux/actions/settings';
|
||||
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
||||
import { selectSdkReady, selectSortByItem, selectTimeItem } from 'redux/selectors/settings';
|
||||
import { selectSortByItem, selectTimeItem } from 'redux/selectors/settings';
|
||||
import TagPage from './view';
|
||||
|
||||
const select = state => ({
|
||||
currentRoute: selectCurrentRoute(state),
|
||||
sdkReady: selectSdkReady(state),
|
||||
sortByItem: selectSortByItem(state),
|
||||
timeItem: selectTimeItem(state),
|
||||
followedTags: selectFollowedTags(state),
|
||||
@@ -22,4 +21,7 @@ const perform = dispatch => ({
|
||||
toggleTagFollow: tag => dispatch(doToggleTagFollow(tag)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(TagPage);
|
||||
export default connect(
|
||||
select,
|
||||
perform
|
||||
)(TagPage);
|
||||
@@ -14,7 +14,6 @@ import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import FloatingWalletBalance from 'component/floatingWalletBalance';
|
||||
import Link from 'component/link';
|
||||
import ModalPicker from 'component/modalPicker';
|
||||
import SdkLoadingStatus from 'component/sdkLoadingStatus';
|
||||
import UriBar from 'component/uriBar';
|
||||
|
||||
class TagPage extends React.PureComponent {
|
||||
@@ -128,7 +127,7 @@ class TagPage extends React.PureComponent {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { navigation, sdkReady, sortByItem, timeItem } = this.props;
|
||||
const { navigation, sortByItem, timeItem } = this.props;
|
||||
const { tag, showSortPicker, showTimePicker } = this.state;
|
||||
|
||||
return (
|
||||
@@ -145,7 +144,7 @@ class TagPage extends React.PureComponent {
|
||||
orientation={Constants.ORIENTATION_VERTICAL}
|
||||
/>
|
||||
)}
|
||||
{sdkReady && !showSortPicker && !showTimePicker && <FloatingWalletBalance navigation={navigation} />}
|
||||
{!showSortPicker && !showTimePicker && <FloatingWalletBalance navigation={navigation} />}
|
||||
{showSortPicker && (
|
||||
<ModalPicker
|
||||
title={__('Sort content by')}
|
||||
@@ -164,7 +163,6 @@ class TagPage extends React.PureComponent {
|
||||
items={Constants.CLAIM_SEARCH_TIME_ITEMS}
|
||||
/>
|
||||
)}
|
||||
{!sdkReady && <SdkLoadingStatus />}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doSetClientSetting } from 'redux/actions/settings';
|
||||
import { makeSelectClientSetting, selectSdkReady } from 'redux/selectors/settings';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
||||
import { selectBalance } from 'lbry-redux';
|
||||
@@ -15,7 +15,6 @@ const select = state => ({
|
||||
deviceWalletSynced: makeSelectClientSetting(Constants.SETTING_DEVICE_WALLET_SYNCED)(state),
|
||||
hasSyncedWallet: selectHasSyncedWallet(state),
|
||||
rewardsNotInterested: makeSelectClientSetting(Constants.SETTING_REWARDS_NOT_INTERESTED)(state),
|
||||
sdkReady: selectSdkReady(state),
|
||||
understandsRisks: makeSelectClientSetting(Constants.SETTING_ALPHA_UNDERSTANDS_RISKS)(state),
|
||||
user: selectUser(state),
|
||||
});
|
||||
@@ -28,4 +27,7 @@ const perform = dispatch => ({
|
||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(WalletPage);
|
||||
export default connect(
|
||||
select,
|
||||
perform
|
||||
)(WalletPage);
|
||||
+12
-15
@@ -1,6 +1,5 @@
|
||||
import React from 'react';
|
||||
import { NativeModules, ScrollView, Text, View } from 'react-native';
|
||||
import EmptyStateView from 'component/emptyStateView';
|
||||
import TransactionListRecent from 'component/transactionListRecent';
|
||||
import WalletAddress from 'component/walletAddress';
|
||||
import WalletBalance from 'component/walletBalance';
|
||||
@@ -9,6 +8,8 @@ import WalletSend from 'component/walletSend';
|
||||
import WalletRewardsDriver from 'component/walletRewardsDriver';
|
||||
import WalletSignIn from 'component/walletSignIn';
|
||||
import WalletSyncDriver from 'component/walletSyncDriver';
|
||||
import Button from 'component/button';
|
||||
import Link from 'component/link';
|
||||
import UriBar from 'component/uriBar';
|
||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
import walletStyle from 'styles/wallet';
|
||||
@@ -59,20 +60,16 @@ class WalletPage extends React.PureComponent {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { balance, rewardsNotInterested, understandsRisks, navigation, sdkReady, user } = this.props;
|
||||
|
||||
if (!sdkReady) {
|
||||
return (
|
||||
<View style={walletStyle.container}>
|
||||
<UriBar navigation={navigation} />
|
||||
<EmptyStateView
|
||||
message={__(
|
||||
'The background service is still initializing. You can still explore and watch content during the initialization process.',
|
||||
)}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
const {
|
||||
balance,
|
||||
backupDismissed,
|
||||
hasSyncedWallet,
|
||||
rewardsNotInterested,
|
||||
understandsRisks,
|
||||
setClientSetting,
|
||||
navigation,
|
||||
user,
|
||||
} = this.props;
|
||||
|
||||
const signedIn = user && user.has_verified_email;
|
||||
if (!signedIn && !understandsRisks) {
|
||||
|
||||
@@ -17,14 +17,6 @@ export function doSetClientSetting(key, value) {
|
||||
};
|
||||
}
|
||||
|
||||
export function doSetSdkReady() {
|
||||
return dispatch => {
|
||||
dispatch({
|
||||
type: Constants.ACTION_SDK_READY,
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export function doSetSortByItem(item) {
|
||||
return dispatch => {
|
||||
dispatch({
|
||||
|
||||
@@ -4,7 +4,6 @@ import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||
const reducers = {};
|
||||
const defaultState = {
|
||||
clientSettings: {},
|
||||
sdkReady: false,
|
||||
sortByItemName: Constants.SORT_BY_HOT,
|
||||
timeItemName: Constants.TIME_WEEK,
|
||||
fullscreenMode: false,
|
||||
@@ -21,11 +20,6 @@ reducers[ACTIONS.CLIENT_SETTING_CHANGED] = (state, action) => {
|
||||
});
|
||||
};
|
||||
|
||||
reducers[Constants.ACTION_SDK_READY] = (state, action) =>
|
||||
Object.assign({}, state, {
|
||||
sdkReady: true,
|
||||
});
|
||||
|
||||
reducers[Constants.ACTION_SORT_BY_ITEM_CHANGED] = (state, action) =>
|
||||
Object.assign({}, state, {
|
||||
sortByItemName: action.data.name,
|
||||
|
||||
@@ -4,22 +4,38 @@ import { getSortByItemForName, getTimeItemForName } from 'utils/helper';
|
||||
|
||||
const selectState = state => state.settings || {};
|
||||
|
||||
export const selectDaemonSettings = createSelector(selectState, state => state.daemonSettings);
|
||||
export const selectDaemonSettings = createSelector(
|
||||
selectState,
|
||||
state => state.daemonSettings
|
||||
);
|
||||
|
||||
export const selectClientSettings = createSelector(selectState, state => state.clientSettings || {});
|
||||
export const selectClientSettings = createSelector(
|
||||
selectState,
|
||||
state => state.clientSettings || {}
|
||||
);
|
||||
|
||||
export const selectSortByItem = createSelector(selectState, state => getSortByItemForName(state.sortByItemName));
|
||||
export const selectSortByItem = createSelector(
|
||||
selectState,
|
||||
state => getSortByItemForName(state.sortByItemName)
|
||||
);
|
||||
|
||||
export const selectTimeItem = createSelector(selectState, state => getTimeItemForName(state.timeItemName));
|
||||
export const selectTimeItem = createSelector(
|
||||
selectState,
|
||||
state => getTimeItemForName(state.timeItemName)
|
||||
);
|
||||
|
||||
export const makeSelectClientSetting = setting =>
|
||||
createSelector(selectClientSettings, settings => (settings ? settings[setting] : undefined));
|
||||
createSelector(
|
||||
selectClientSettings,
|
||||
settings => (settings ? settings[setting] : undefined)
|
||||
);
|
||||
|
||||
// refactor me
|
||||
export const selectShowNsfw = makeSelectClientSetting(SETTINGS.SHOW_NSFW);
|
||||
|
||||
export const selectKeepDaemonRunning = makeSelectClientSetting(SETTINGS.KEEP_DAEMON_RUNNING);
|
||||
|
||||
export const selectFullscreenMode = createSelector(selectState, state => state.fullscreenMode);
|
||||
|
||||
export const selectSdkReady = createSelector(selectState, state => state.sdkReady);
|
||||
export const selectFullscreenMode = createSelector(
|
||||
selectState,
|
||||
state => state.fullscreenMode
|
||||
);
|
||||
@@ -398,23 +398,6 @@ const discoverStyle = StyleSheet.create({
|
||||
fontSize: 14,
|
||||
textAlign: 'center',
|
||||
},
|
||||
sdkLoading: {
|
||||
position: 'absolute',
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
padding: 8,
|
||||
backgroundColor: Colors.LbryGreen,
|
||||
},
|
||||
sdkLoadingText: {
|
||||
fontFamily: 'Inter-Regular',
|
||||
fontSize: 14,
|
||||
color: Colors.White,
|
||||
marginLeft: 8,
|
||||
},
|
||||
});
|
||||
|
||||
export default discoverStyle;
|
||||
@@ -4591,17 +4591,17 @@ latest-version@^3.0.0:
|
||||
dependencies:
|
||||
package-json "^4.0.0"
|
||||
|
||||
lbry-redux@lbryio/lbry-redux#69ffd110dbf3633e5847f61f008751edec033017:
|
||||
lbry-redux@lbryio/lbry-redux#f6e99498d2bc5b3f07e1e2b6f668a1a48de35047:
|
||||
version "0.0.1"
|
||||
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/69ffd110dbf3633e5847f61f008751edec033017"
|
||||
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/f6e99498d2bc5b3f07e1e2b6f668a1a48de35047"
|
||||
dependencies:
|
||||
proxy-polyfill "0.1.6"
|
||||
reselect "^3.0.0"
|
||||
uuid "^3.3.2"
|
||||
|
||||
lbryinc@lbryio/lbryinc#021ac75d9aa2db488cfff8e9be320402f038f955:
|
||||
lbryinc@lbryio/lbryinc#1fc104c2d29d1d3975234c3606e848eaa28e1b6e:
|
||||
version "0.0.1"
|
||||
resolved "https://codeload.github.com/lbryio/lbryinc/tar.gz/021ac75d9aa2db488cfff8e9be320402f038f955"
|
||||
resolved "https://codeload.github.com/lbryio/lbryinc/tar.gz/1fc104c2d29d1d3975234c3606e848eaa28e1b6e"
|
||||
dependencies:
|
||||
reselect "^3.0.0"
|
||||
|
||||
|
||||
Reference in new issue
Block a user