lbry.tv hybrid mode #132
17 changed files with 153 additions and 74 deletions
2
android
2
android
|
@ -1 +1 @@
|
||||||
Subproject commit 558b609ce2b7301437a2b8db237621b32bedade9
|
Subproject commit 6d4d9965137441d4d0d460814b1d89d67f23bc81
|
|
@ -68,7 +68,7 @@ class DrawerContent extends React.PureComponent {
|
||||||
|
|
||||||
handleItemPress = routeName => {
|
handleItemPress = routeName => {
|
||||||
const { navigation, notify, sdkReady } = this.props;
|
const { navigation, notify, sdkReady } = this.props;
|
||||||
if (true && routesRequiringSdkReady.includes(routeName)) {
|
if (!sdkReady && routesRequiringSdkReady.includes(routeName)) {
|
||||||
if (navigation.closeDrawer) {
|
if (navigation.closeDrawer) {
|
||||||
navigation.closeDrawer();
|
navigation.closeDrawer();
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,7 +125,9 @@ class FileListItem extends React.PureComponent {
|
||||||
const outpointsToHide = !blackListedOutpoints
|
const outpointsToHide = !blackListedOutpoints
|
||||||
? filteredOutpoints
|
? filteredOutpoints
|
||||||
: blackListedOutpoints.concat(filteredOutpoints);
|
: blackListedOutpoints.concat(filteredOutpoints);
|
||||||
shouldHide = outpointsToHide.some(outpoint => outpoint.txid === claim.txid && outpoint.nout === claim.nout);
|
shouldHide = outpointsToHide.some(
|
||||||
|
outpoint => outpoint && outpoint.txid === claim.txid && outpoint.nout === claim.nout,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: hide channels on tag pages?
|
// TODO: hide channels on tag pages?
|
||||||
|
@ -143,10 +145,14 @@ class FileListItem extends React.PureComponent {
|
||||||
<View>
|
<View>
|
||||||
{isRepost && (
|
{isRepost && (
|
||||||
<View style={fileListStyle.repostInfo}>
|
<View style={fileListStyle.repostInfo}>
|
||||||
<Icon name={"retweet"} size={14} style={fileListStyle.repostIcon} />
|
<Icon name={'retweet'} size={14} style={fileListStyle.repostIcon} />
|
||||||
<Text style={fileListStyle.repostChannelName}>
|
<Text style={fileListStyle.repostChannelName}>
|
||||||
<Link text={repostChannel}
|
<Link
|
||||||
onPress={() => navigateToUri(navigation, normalizeURI(repostChannelUrl), null, false, null, false)} /> reposted</Text>
|
text={repostChannel}
|
||||||
|
onPress={() => navigateToUri(navigation, normalizeURI(repostChannelUrl), null, false, null, false)}
|
||||||
|
/>{' '}
|
||||||
|
reposted
|
||||||
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ import {
|
||||||
import { doUpdateChannelFormState, doClearChannelFormState } from 'redux/actions/form';
|
import { doUpdateChannelFormState, doClearChannelFormState } from 'redux/actions/form';
|
||||||
import { selectDrawerStack } from 'redux/selectors/drawer';
|
import { selectDrawerStack } from 'redux/selectors/drawer';
|
||||||
import { selectChannelFormState, selectHasChannelFormState } from 'redux/selectors/form';
|
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 Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import ChannelCreator from './view';
|
import ChannelCreator from './view';
|
||||||
|
|
||||||
|
@ -33,6 +34,7 @@ const select = state => ({
|
||||||
fetchingChannels: selectFetchingMyChannels(state),
|
fetchingChannels: selectFetchingMyChannels(state),
|
||||||
balance: selectBalance(state),
|
balance: selectBalance(state),
|
||||||
hasFormState: selectHasChannelFormState(state),
|
hasFormState: selectHasChannelFormState(state),
|
||||||
|
sdkReady: selectSdkReady(state),
|
||||||
updatingChannel: selectUpdatingChannel(state),
|
updatingChannel: selectUpdatingChannel(state),
|
||||||
updateChannelError: selectUpdateChannelError(state),
|
updateChannelError: selectUpdateChannelError(state),
|
||||||
});
|
});
|
||||||
|
@ -52,7 +54,4 @@ const perform = dispatch => ({
|
||||||
setExplicitNavigateBack: flag => dispatch(doSetExplicitNavigateBack(flag)),
|
setExplicitNavigateBack: flag => dispatch(doSetExplicitNavigateBack(flag)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(select, perform)(ChannelCreator);
|
||||||
select,
|
|
||||||
perform,
|
|
||||||
)(ChannelCreator);
|
|
||||||
|
|
|
@ -176,9 +176,7 @@ export default class ChannelCreator extends React.PureComponent {
|
||||||
NativeModules.Firebase.setCurrentScreen('Channels').then(result => {
|
NativeModules.Firebase.setCurrentScreen('Channels').then(result => {
|
||||||
pushDrawerStack(Constants.DRAWER_ROUTE_CHANNEL_CREATOR, navigation.state.params ? navigation.state.params : null);
|
pushDrawerStack(Constants.DRAWER_ROUTE_CHANNEL_CREATOR, navigation.state.params ? navigation.state.params : null);
|
||||||
setPlayerVisible();
|
setPlayerVisible();
|
||||||
if (!fetchingChannels) {
|
|
||||||
fetchChannelListMine();
|
fetchChannelListMine();
|
||||||
}
|
|
||||||
|
|
||||||
DeviceEventEmitter.addListener('onDocumentPickerFilePicked', this.onFilePicked);
|
DeviceEventEmitter.addListener('onDocumentPickerFilePicked', this.onFilePicked);
|
||||||
DeviceEventEmitter.addListener('onDocumentPickerCanceled', this.onPickerCanceled);
|
DeviceEventEmitter.addListener('onDocumentPickerCanceled', this.onPickerCanceled);
|
||||||
|
@ -802,7 +800,15 @@ export default class ChannelCreator extends React.PureComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { abandoningClaimIds, balance, fetchingChannels, updatingChannel, channels = [], navigation } = this.props;
|
const {
|
||||||
|
abandoningClaimIds,
|
||||||
|
balance,
|
||||||
|
fetchingChannels,
|
||||||
|
sdkReady,
|
||||||
|
updatingChannel,
|
||||||
|
channels = [],
|
||||||
|
navigation,
|
||||||
|
} = this.props;
|
||||||
const {
|
const {
|
||||||
autoStyle,
|
autoStyle,
|
||||||
autoStyles,
|
autoStyles,
|
||||||
|
@ -826,6 +832,19 @@ export default class ChannelCreator extends React.PureComponent {
|
||||||
|
|
||||||
const hasChannels = channels && channels.length > 0;
|
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 (
|
return (
|
||||||
<View style={channelCreatorStyle.container}>
|
<View style={channelCreatorStyle.container}>
|
||||||
<UriBar
|
<UriBar
|
||||||
|
|
|
@ -11,15 +11,17 @@ import {
|
||||||
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||||
import { doDeleteFile } from 'redux/actions/file';
|
import { doDeleteFile } from 'redux/actions/file';
|
||||||
import { selectCurrentRoute } from 'redux/selectors/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'; // eslint-disable-line node/no-deprecated-api
|
||||||
import DownloadsPage from './view';
|
import DownloadsPage from './view';
|
||||||
|
|
||||||
const select = state => ({
|
const select = state => ({
|
||||||
claims: selectMyClaimsWithoutChannels(state),
|
claims: selectMyClaimsWithoutChannels(state),
|
||||||
currentRoute: selectCurrentRoute(state),
|
currentRoute: selectCurrentRoute(state),
|
||||||
fileInfos: selectFileInfosDownloaded(state),
|
|
||||||
downloadedUris: selectDownloadedUris(state),
|
downloadedUris: selectDownloadedUris(state),
|
||||||
|
fileInfos: selectFileInfosDownloaded(state),
|
||||||
fetching: selectIsFetchingFileList(state) || selectIsFetchingClaimListMine(state),
|
fetching: selectIsFetchingFileList(state) || selectIsFetchingClaimListMine(state),
|
||||||
|
sdkReady: selectSdkReady(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
|
@ -32,7 +34,4 @@ const perform = dispatch => ({
|
||||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(select, perform)(DownloadsPage);
|
||||||
select,
|
|
||||||
perform
|
|
||||||
)(DownloadsPage);
|
|
||||||
|
|
|
@ -144,11 +144,24 @@ class DownloadsPage extends React.PureComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { fetching, claims, downloadedUris, fileInfos, navigation } = this.props;
|
const { downloadedUris, fetching, navigation, sdkReady } = this.props;
|
||||||
const { selectionMode, selectedUris } = this.state;
|
const { selectionMode, selectedUris } = this.state;
|
||||||
const filteredUris = this.getFilteredUris();
|
const filteredUris = this.getFilteredUris();
|
||||||
const hasDownloads = filteredUris && filteredUris.length > 0;
|
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 (
|
return (
|
||||||
<View style={downloadsStyle.container}>
|
<View style={downloadsStyle.container}>
|
||||||
<UriBar
|
<UriBar
|
||||||
|
|
|
@ -12,23 +12,22 @@ import {
|
||||||
doFetchInviteStatus,
|
doFetchInviteStatus,
|
||||||
doUserInviteNew,
|
doUserInviteNew,
|
||||||
} from 'lbryinc';
|
} from 'lbryinc';
|
||||||
import { doPushDrawerStack, doPopDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||||
import { doUpdateChannelFormState, doClearChannelFormState } from 'redux/actions/form';
|
import { selectSdkReady } from 'redux/selectors/settings';
|
||||||
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 Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import InvitesPage from './view';
|
import InvitesPage from './view';
|
||||||
|
|
||||||
const select = state => ({
|
const select = state => ({
|
||||||
channels: selectMyChannelClaims(state),
|
channels: selectMyChannelClaims(state),
|
||||||
|
errorMessage: selectUserInviteNewErrorMessage(state),
|
||||||
fetchingChannels: selectFetchingMyChannels(state),
|
fetchingChannels: selectFetchingMyChannels(state),
|
||||||
fetchingInvitees: selectUserInviteStatusIsPending(state),
|
fetchingInvitees: selectUserInviteStatusIsPending(state),
|
||||||
errorMessage: selectUserInviteNewErrorMessage(state),
|
|
||||||
invitesRemaining: selectUserInvitesRemaining(state),
|
|
||||||
referralCode: selectUserInviteReferralCode(state),
|
|
||||||
isPending: selectUserInviteNewIsPending(state),
|
|
||||||
invitees: selectUserInvitees(state),
|
invitees: selectUserInvitees(state),
|
||||||
|
invitesRemaining: selectUserInvitesRemaining(state),
|
||||||
|
isPending: selectUserInviteNewIsPending(state),
|
||||||
|
referralCode: selectUserInviteReferralCode(state),
|
||||||
referralReward: selectReferralReward(state),
|
referralReward: selectReferralReward(state),
|
||||||
|
sdkReady: selectSdkReady(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
|
@ -40,7 +39,4 @@ const perform = dispatch => ({
|
||||||
notify: data => dispatch(doToast(data)),
|
notify: data => dispatch(doToast(data)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(select, perform)(InvitesPage);
|
||||||
select,
|
|
||||||
perform,
|
|
||||||
)(InvitesPage);
|
|
||||||
|
|
|
@ -11,14 +11,10 @@ import {
|
||||||
View,
|
View,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import Colors from 'styles/colors';
|
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 Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
import Link from 'component/link';
|
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
import ChannelSelector from 'component/channelSelector';
|
import ChannelSelector from 'component/channelSelector';
|
||||||
import PageHeader from 'component/pageHeader';
|
import EmptyStateView from 'component/emptyStateView';
|
||||||
import RewardCard from 'component/rewardCard';
|
|
||||||
import RewardEnrolment from 'component/rewardEnrolment';
|
|
||||||
import UriBar from 'component/uriBar';
|
import UriBar from 'component/uriBar';
|
||||||
import invitesStyle from 'styles/invites';
|
import invitesStyle from 'styles/invites';
|
||||||
import { fetchReferralCode, logPublish } from 'utils/helper';
|
import { fetchReferralCode, logPublish } from 'utils/helper';
|
||||||
|
@ -134,10 +130,23 @@ class InvitesPage extends React.PureComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { fetchingInvitees, user, navigation, notify, isPending, invitees } = this.props;
|
const { fetchingInvitees, invitees, isPending, navigation, sdkReady } = this.props;
|
||||||
const { email, inviteLink } = this.state;
|
const { email } = this.state;
|
||||||
const hasInvitees = invitees && invitees.length > 0;
|
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 (
|
return (
|
||||||
<View style={invitesStyle.container}>
|
<View style={invitesStyle.container}>
|
||||||
<UriBar navigation={navigation} />
|
<UriBar navigation={navigation} />
|
||||||
|
|
|
@ -13,6 +13,7 @@ import { selectDrawerStack } from 'redux/selectors/drawer';
|
||||||
import { doUpdatePublishFormState, doClearPublishFormState, doPendingPublishSuccess } from 'redux/actions/form';
|
import { doUpdatePublishFormState, doClearPublishFormState, doPendingPublishSuccess } from 'redux/actions/form';
|
||||||
import { doPushDrawerStack, doPopDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
import { doPushDrawerStack, doPopDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||||
import { selectPublishFormState, selectHasPublishFormState } from 'redux/selectors/form';
|
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 Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import PublishPage from './view';
|
import PublishPage from './view';
|
||||||
|
|
||||||
|
@ -23,6 +24,7 @@ const select = state => ({
|
||||||
myClaims: selectMyClaims(state),
|
myClaims: selectMyClaims(state),
|
||||||
publishFormState: selectPublishFormState(state),
|
publishFormState: selectPublishFormState(state),
|
||||||
publishFormValues: selectPublishFormValues(state),
|
publishFormValues: selectPublishFormValues(state),
|
||||||
|
sdkReady: selectSdkReady(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
|
@ -39,7 +41,4 @@ const perform = dispatch => ({
|
||||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(select, perform)(PublishPage);
|
||||||
select,
|
|
||||||
perform,
|
|
||||||
)(PublishPage);
|
|
||||||
|
|
|
@ -37,6 +37,7 @@ import Button from 'component/button';
|
||||||
import ChannelSelector from 'component/channelSelector';
|
import ChannelSelector from 'component/channelSelector';
|
||||||
import Colors from 'styles/colors';
|
import Colors from 'styles/colors';
|
||||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
|
import EmptyStateView from 'component/emptyStateView';
|
||||||
import FastImage from 'react-native-fast-image';
|
import FastImage from 'react-native-fast-image';
|
||||||
import FloatingWalletBalance from 'component/floatingWalletBalance';
|
import FloatingWalletBalance from 'component/floatingWalletBalance';
|
||||||
import Icon from 'react-native-vector-icons/FontAwesome5';
|
import Icon from 'react-native-vector-icons/FontAwesome5';
|
||||||
|
@ -974,7 +975,7 @@ class PublishPage extends React.PureComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { balance, navigation, notify, publishFormValues } = this.props;
|
const { balance, navigation, notify, sdkReady } = this.props;
|
||||||
const {
|
const {
|
||||||
allThumbnailsChecked,
|
allThumbnailsChecked,
|
||||||
canUseCamera,
|
canUseCamera,
|
||||||
|
@ -987,6 +988,19 @@ class PublishPage extends React.PureComponent {
|
||||||
videos,
|
videos,
|
||||||
} = this.state;
|
} = 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;
|
let content;
|
||||||
if (Constants.PHASE_SELECTOR === currentPhase) {
|
if (Constants.PHASE_SELECTOR === currentPhase) {
|
||||||
content = (
|
content = (
|
||||||
|
|
|
@ -9,6 +9,7 @@ import {
|
||||||
selectIsFetchingClaimListMine,
|
selectIsFetchingClaimListMine,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
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 Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import PublishesPage from './view';
|
import PublishesPage from './view';
|
||||||
|
|
||||||
|
@ -16,6 +17,7 @@ const select = state => ({
|
||||||
uris: selectMyClaimUrisWithoutChannels(state),
|
uris: selectMyClaimUrisWithoutChannels(state),
|
||||||
fetching: selectIsFetchingClaimListMine(state),
|
fetching: selectIsFetchingClaimListMine(state),
|
||||||
pendingClaims: selectPendingClaims(state),
|
pendingClaims: selectPendingClaims(state),
|
||||||
|
sdkReady: selectSdkReady(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
|
@ -27,7 +29,4 @@ const perform = dispatch => ({
|
||||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(select, perform)(PublishesPage);
|
||||||
select,
|
|
||||||
perform
|
|
||||||
)(PublishesPage);
|
|
||||||
|
|
|
@ -114,14 +114,27 @@ class PublishesPage extends React.PureComponent {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
{ cancelable: true }
|
{ cancelable: true },
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { fetching, navigation, uris } = this.props;
|
const { fetching, navigation, sdkReady, uris } = this.props;
|
||||||
const { selectionMode, selectedUris } = this.state;
|
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 (
|
return (
|
||||||
<View style={publishStyle.container}>
|
<View style={publishStyle.container}>
|
||||||
<UriBar
|
<UriBar
|
||||||
|
|
|
@ -12,7 +12,8 @@ import {
|
||||||
import { doToast } from 'lbry-redux';
|
import { doToast } from 'lbry-redux';
|
||||||
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||||
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
||||||
import Constants from 'constants';
|
import { selectSdkReady } from 'redux/selectors/settings';
|
||||||
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import RewardsPage from './view';
|
import RewardsPage from './view';
|
||||||
|
|
||||||
const select = state => ({
|
const select = state => ({
|
||||||
|
@ -22,6 +23,7 @@ const select = state => ({
|
||||||
emailVerifyPending: selectEmailVerifyIsPending(state),
|
emailVerifyPending: selectEmailVerifyIsPending(state),
|
||||||
fetching: selectFetchingRewards(state),
|
fetching: selectFetchingRewards(state),
|
||||||
rewards: selectUnclaimedRewards(state),
|
rewards: selectUnclaimedRewards(state),
|
||||||
|
sdkReady: selectSdkReady(state),
|
||||||
user: selectUser(state),
|
user: selectUser(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -33,7 +35,4 @@ const perform = dispatch => ({
|
||||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(select, perform)(RewardsPage);
|
||||||
select,
|
|
||||||
perform
|
|
||||||
)(RewardsPage);
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import Colors from 'styles/colors';
|
||||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import Link from 'component/link';
|
import Link from 'component/link';
|
||||||
import CustomRewardCard from 'component/customRewardCard';
|
import CustomRewardCard from 'component/customRewardCard';
|
||||||
import PageHeader from 'component/pageHeader';
|
import EmptyStateView from 'component/emptyStateView';
|
||||||
import RewardCard from 'component/rewardCard';
|
import RewardCard from 'component/rewardCard';
|
||||||
import RewardEnrolment from 'component/rewardEnrolment';
|
import RewardEnrolment from 'component/rewardEnrolment';
|
||||||
import UriBar from 'component/uriBar';
|
import UriBar from 'component/uriBar';
|
||||||
|
@ -192,9 +192,22 @@ class RewardsPage extends React.PureComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { user, navigation } = this.props;
|
const { navigation, sdkReady } = this.props;
|
||||||
const { currentFilter } = this.state;
|
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 (
|
return (
|
||||||
<View style={rewardStyle.container}>
|
<View style={rewardStyle.container}>
|
||||||
<UriBar navigation={navigation} />
|
<UriBar navigation={navigation} />
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doSetClientSetting } from 'redux/actions/settings';
|
import { doSetClientSetting } from 'redux/actions/settings';
|
||||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
import { makeSelectClientSetting, selectSdkReady } from 'redux/selectors/settings';
|
||||||
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
||||||
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
||||||
import { selectBalance } from 'lbry-redux';
|
import { selectBalance } from 'lbry-redux';
|
||||||
|
@ -15,6 +15,7 @@ const select = state => ({
|
||||||
deviceWalletSynced: makeSelectClientSetting(Constants.SETTING_DEVICE_WALLET_SYNCED)(state),
|
deviceWalletSynced: makeSelectClientSetting(Constants.SETTING_DEVICE_WALLET_SYNCED)(state),
|
||||||
hasSyncedWallet: selectHasSyncedWallet(state),
|
hasSyncedWallet: selectHasSyncedWallet(state),
|
||||||
rewardsNotInterested: makeSelectClientSetting(Constants.SETTING_REWARDS_NOT_INTERESTED)(state),
|
rewardsNotInterested: makeSelectClientSetting(Constants.SETTING_REWARDS_NOT_INTERESTED)(state),
|
||||||
|
sdkReady: selectSdkReady(state),
|
||||||
understandsRisks: makeSelectClientSetting(Constants.SETTING_ALPHA_UNDERSTANDS_RISKS)(state),
|
understandsRisks: makeSelectClientSetting(Constants.SETTING_ALPHA_UNDERSTANDS_RISKS)(state),
|
||||||
user: selectUser(state),
|
user: selectUser(state),
|
||||||
});
|
});
|
||||||
|
@ -27,7 +28,4 @@ const perform = dispatch => ({
|
||||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(
|
export default connect(select, perform)(WalletPage);
|
||||||
select,
|
|
||||||
perform
|
|
||||||
)(WalletPage);
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { NativeModules, ScrollView, Text, View } from 'react-native';
|
import { NativeModules, ScrollView, Text, View } from 'react-native';
|
||||||
|
import EmptyStateView from 'component/emptyStateView';
|
||||||
import TransactionListRecent from 'component/transactionListRecent';
|
import TransactionListRecent from 'component/transactionListRecent';
|
||||||
import WalletAddress from 'component/walletAddress';
|
import WalletAddress from 'component/walletAddress';
|
||||||
import WalletBalance from 'component/walletBalance';
|
import WalletBalance from 'component/walletBalance';
|
||||||
|
@ -8,8 +9,6 @@ import WalletSend from 'component/walletSend';
|
||||||
import WalletRewardsDriver from 'component/walletRewardsDriver';
|
import WalletRewardsDriver from 'component/walletRewardsDriver';
|
||||||
import WalletSignIn from 'component/walletSignIn';
|
import WalletSignIn from 'component/walletSignIn';
|
||||||
import WalletSyncDriver from 'component/walletSyncDriver';
|
import WalletSyncDriver from 'component/walletSyncDriver';
|
||||||
import Button from 'component/button';
|
|
||||||
import Link from 'component/link';
|
|
||||||
import UriBar from 'component/uriBar';
|
import UriBar from 'component/uriBar';
|
||||||
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
||||||
import walletStyle from 'styles/wallet';
|
import walletStyle from 'styles/wallet';
|
||||||
|
@ -60,16 +59,20 @@ class WalletPage extends React.PureComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const { balance, rewardsNotInterested, understandsRisks, navigation, sdkReady, user } = this.props;
|
||||||
balance,
|
|
||||||
backupDismissed,
|
if (!sdkReady) {
|
||||||
hasSyncedWallet,
|
return (
|
||||||
rewardsNotInterested,
|
<View style={walletStyle.container}>
|
||||||
understandsRisks,
|
<UriBar navigation={navigation} />
|
||||||
setClientSetting,
|
<EmptyStateView
|
||||||
navigation,
|
message={__(
|
||||||
user,
|
'The background service is still initializing. You can still explore and watch content during the initialization process.',
|
||||||
} = this.props;
|
)}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const signedIn = user && user.has_verified_email;
|
const signedIn = user && user.has_verified_email;
|
||||||
if (!signedIn && !understandsRisks) {
|
if (!signedIn && !understandsRisks) {
|
||||||
|
|
Loading…
Reference in a new issue