Compare commits

..
5 Commits
7 changed files with 24 additions and 64 deletions

No files matched your search

+1 -9
View File
@@ -27,15 +27,7 @@ import {
createNavigationReducer,
} from 'react-navigation-redux-helpers';
import { connect } from 'react-redux';
import {
AppState,
BackHandler,
DeviceEventEmitter,
Linking,
NativeModules,
TextInput,
ToastAndroid,
} from 'react-native';
import { AppState, BackHandler, Linking, NativeModules, TextInput, ToastAndroid } from 'react-native';
import { selectDrawerStack } from 'redux/selectors/drawer';
import { SETTINGS, doDismissToast, doPopulateSharedUserState, doPreferenceGet, doToast, selectToast } from 'lbry-redux';
import {
+1 -3
View File
@@ -66,9 +66,7 @@ class FileItem extends React.PureComponent {
let shouldHide = false;
if (blackListedOutpoints || filteredOutpoints) {
const outpointsToHide = !blackListedOutpoints
? filteredOutpoints
: blackListedOutpoints.concat(filteredOutpoints);
const outpointsToHide = blackListedOutpoints.concat(filteredOutpoints);
shouldHide = outpointsToHide.some(outpoint => outpoint.txid === claim.txid && outpoint.nout === claim.nout);
}
if (shouldHide) {
+1 -3
View File
@@ -120,9 +120,7 @@ class FileListItem extends React.PureComponent {
shortChannelUri = signingChannel ? signingChannel.short_url : null;
if (blackListedOutpoints || filteredOutpoints) {
const outpointsToHide = !blackListedOutpoints
? filteredOutpoints
: blackListedOutpoints.concat(filteredOutpoints);
const outpointsToHide = blackListedOutpoints.concat(filteredOutpoints);
shouldHide = outpointsToHide.some(outpoint => outpoint.txid === claim.txid && outpoint.nout === claim.nout);
}
+2 -3
View File
@@ -82,8 +82,7 @@ class WalletSend extends React.PureComponent<Props> {
render() {
const { balance } = this.props;
const canSend =
this.state.address && this.state.amount > 0 && this.state.address.trim().length > 0 && this.state.addressValid;
const canSend = this.state.address && this.state.amount > 0 && this.state.address.trim().length > 0;
return (
<View style={walletStyle.card}>
@@ -95,7 +94,7 @@ class WalletSend extends React.PureComponent<Props> {
this.setState({
address: value,
addressChanged: true,
addressValid: value.trim().length === 0 || regexAddress.test(value),
addressValid: value.trim().length == 0 || regexAddress.test(value),
})
}
onBlur={this.handleAddressInputBlur}
+2 -2
View File
@@ -142,7 +142,7 @@ class SearchPage extends React.PureComponent {
<FileListItem uri={currentUri} featuredResult style={searchStyle.featuredResultItem} navigation={navigation} />
{showTagResult && (
<TouchableOpacity style={searchStyle.tagResultItem} onPress={() => this.handleTagResultPressed(query)}>
<Text style={searchStyle.tagResultTitle}>#{query.toLowerCase()}</Text>
<Text style={searchStyle.tagResultTitle}>#{query}</Text>
<Text style={searchStyle.tagResultDescription}>Explore content for this tag</Text>
</TouchableOpacity>
)}
@@ -152,7 +152,7 @@ class SearchPage extends React.PureComponent {
handleTagResultPressed = tag => {
const { navigation } = this.props;
navigation.navigate({ routeName: Constants.DRAWER_ROUTE_TAG, key: `tagPage`, params: { tag: tag.toLowerCase() } });
navigation.navigate({ routeName: Constants.DRAWER_ROUTE_TAG, key: `tagPage`, params: { tag } });
};
render() {
+1 -1
View File
@@ -140,7 +140,7 @@ class SettingsPage extends React.PureComponent {
<View style={settingsStyle.row}>
<View style={settingsStyle.switchText}>
<Text style={settingsStyle.label}>{__('Content Interests')}</Text>
<Text style={settingsStyle.label}>{__('Tags you follow')}</Text>
</View>
<View style={settingsStyle.switchContainer}>
<Switch
+16 -43
View File
@@ -1,7 +1,7 @@
import React from 'react';
import { Lbry, doPreferenceGet } from 'lbry-redux';
import { Lbryio } from 'lbryinc';
import { ActivityIndicator, DeviceEventEmitter, Linking, NativeModules, Platform, Text, View } from 'react-native';
import { ActivityIndicator, Linking, NativeModules, Platform, Text, View } from 'react-native';
import { NavigationActions, StackActions } from 'react-navigation';
import { decode as atob } from 'base-64';
import { navigateToUri, transformUrl } from 'utils/helper';
@@ -52,10 +52,7 @@ class SplashScreen extends React.PureComponent {
});
navigation.dispatch(resetAction);
const launchUrl =
navigation.state.params && navigation.state.params.launchUrl
? navigation.state.params.launchUrl
: this.state.launchUrl;
const launchUrl = navigation.state.params ? navigation.state.params.launchUrl : this.state.launchUrl;
if (launchUrl) {
if (launchUrl.startsWith('lbry://?verify=')) {
let verification = {};
@@ -121,12 +118,6 @@ class SplashScreen extends React.PureComponent {
);
};
onNotificationTargetLaunch = evt => {
if (evt.url && evt.url.startsWith('lbry://')) {
this.setState({ launchUrl: evt.url });
}
};
finishSplashScreen = () => {
const {
authenticate,
@@ -158,10 +149,7 @@ class SplashScreen extends React.PureComponent {
NativeModules.VersionInfo.getAppVersion().then(appVersion => {
this.setState({ shouldAuthenticate: true });
NativeModules.Firebase.getMessagingToken()
.then(firebaseToken => {
console.log(firebaseToken);
authenticate(appVersion, Platform.OS, firebaseToken);
})
.then(firebaseToken => authenticate(appVersion, Platform.OS, firebaseToken))
.catch(() => authenticate(appVersion, Platform.OS));
});
}
@@ -262,14 +250,6 @@ class SplashScreen extends React.PureComponent {
}, 1000);
}
componentWillMount() {
DeviceEventEmitter.addListener('onNotificationTargetLaunch', this.onNotificationTargetLaunch);
}
componentWillUnmount() {
DeviceEventEmitter.removeListener('onNotificationTargetLaunch', this.onNotificationTargetLaunch);
}
componentDidMount() {
NativeModules.Firebase.track('app_launch', null);
NativeModules.Firebase.setCurrentScreen('Splash');
@@ -279,26 +259,6 @@ class SplashScreen extends React.PureComponent {
if (url) {
this.setState({ launchUrl: url });
}
NativeModules.UtilityModule.getNotificationLaunchTarget().then(target => {
if (target) {
this.setState({ launchUrl: target });
}
// Only connect after checking initial launch url / notification launch target
Lbry.connect()
.then(() => {
this.updateStatus();
})
.catch(e => {
this.setState({
isLagging: true,
message: 'Connection Failure',
details:
'We could not establish a connection to the daemon. Your data connection may be preventing LBRY from connecting. Contact hello@lbry.com if you think this is a software bug.',
});
});
});
});
// Start measuring the first launch time from the splash screen
@@ -310,6 +270,19 @@ class SplashScreen extends React.PureComponent {
AsyncStorage.setItem('firstLaunchTime', String(moment().unix()));
}
});
Lbry.connect()
.then(() => {
this.updateStatus();
})
.catch(e => {
this.setState({
isLagging: true,
message: 'Connection Failure',
details:
'We could not establish a connection to the daemon. Your data connection may be preventing LBRY from connecting. Contact hello@lbry.com if you think this is a software bug.',
});
});
}
handleContinueAnywayPressed = () => {