more updates for release

This commit is contained in:
Akinwale Ariwodola 2019-10-16 17:08:16 +01:00
parent eb12a361b7
commit 48030a97f2
13 changed files with 62 additions and 32 deletions

4
package-lock.json generated
View file

@ -5640,8 +5640,8 @@
} }
}, },
"lbry-redux": { "lbry-redux": {
"version": "github:lbryio/lbry-redux#98723e0c3cc48340d5a1c7100700fcae69298a2e", "version": "github:lbryio/lbry-redux#9919a8150998822ca997cd23418f023d64d4a3da",
"from": "github:lbryio/lbry-redux#98723e0c3cc48340d5a1c7100700fcae69298a2e", "from": "github:lbryio/lbry-redux#9919a8150998822ca997cd23418f023d64d4a3da",
"requires": { "requires": {
"proxy-polyfill": "0.1.6", "proxy-polyfill": "0.1.6",
"reselect": "^3.0.0", "reselect": "^3.0.0",

View file

@ -12,7 +12,7 @@
"base-64": "^0.1.0", "base-64": "^0.1.0",
"@expo/vector-icons": "^8.1.0", "@expo/vector-icons": "^8.1.0",
"gfycat-style-urls": "^1.0.3", "gfycat-style-urls": "^1.0.3",
"lbry-redux": "lbryio/lbry-redux#98723e0c3cc48340d5a1c7100700fcae69298a2e", "lbry-redux": "lbryio/lbry-redux#9919a8150998822ca997cd23418f023d64d4a3da",
"lbryinc": "lbryio/lbryinc#aebad10a9c5d725c3fedae4236d56f239a0bc1de", "lbryinc": "lbryio/lbryinc#aebad10a9c5d725c3fedae4236d56f239a0bc1de",
"lodash": ">=4.17.11", "lodash": ">=4.17.11",
"merge": ">=1.2.1", "merge": ">=1.2.1",

View file

@ -272,6 +272,7 @@ class AppWithNavigationState extends React.Component {
constructor() { constructor() {
super(); super();
this.emailVerifyCheckInterval = null; this.emailVerifyCheckInterval = null;
this.syncGetInterval = null;
this.state = { this.state = {
emailVerifyDone: false, emailVerifyDone: false,
verifyPending: false, verifyPending: false,
@ -301,10 +302,10 @@ class AppWithNavigationState extends React.Component {
Linking.addEventListener('url', this._handleUrl); Linking.addEventListener('url', this._handleUrl);
// call /sync/get with interval // call /sync/get with interval
setInterval(() => { this.syncGetInterval = setInterval(() => {
this.setState({ syncHashChanged: false }); // reset local state this.setState({ syncHashChanged: false }); // reset local state
NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(walletPassword => { NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(walletPassword => {
dispatch(doGetSync(walletPassword)); dispatch(doGetSync(walletPassword, () => this.getUserSettings()));
}); });
}, SYNC_GET_INTERVAL); }, SYNC_GET_INTERVAL);
} }
@ -336,6 +337,12 @@ class AppWithNavigationState extends React.Component {
AppState.removeEventListener('change', this._handleAppStateChange); AppState.removeEventListener('change', this._handleAppStateChange);
BackHandler.removeEventListener('hardwareBackPress'); BackHandler.removeEventListener('hardwareBackPress');
Linking.removeEventListener('url', this._handleUrl); Linking.removeEventListener('url', this._handleUrl);
if (this.emailVerifyCheckInterval > -1) {
clearInterval(this.emailVerifyCheckInterval);
}
if (this.syncGetInterval > -1) {
clearInterval(this.syncGetInterval);
}
} }
componentDidUpdate() { componentDidUpdate() {

View file

@ -20,7 +20,7 @@ const perform = dispatch => ({
notify: data => dispatch(doToast(data)), notify: data => dispatch(doToast(data)),
createChannel: (name, amount) => dispatch(doCreateChannel(name, amount)), createChannel: (name, amount) => dispatch(doCreateChannel(name, amount)),
fetchChannelListMine: () => dispatch(doFetchChannelListMine()), fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
getSync: password => dispatch(doGetSync(password)), getSync: (password, callback) => dispatch(doGetSync(password, callback)),
}); });
export default connect( export default connect(

View file

@ -5,6 +5,7 @@ import { AppRegistry, Text, View, NativeModules } from 'react-native';
import { import {
Lbry, Lbry,
buildSharedStateMiddleware, buildSharedStateMiddleware,
blockedReducer,
claimsReducer, claimsReducer,
contentReducer, contentReducer,
fileReducer, fileReducer,
@ -52,6 +53,7 @@ import thunk from 'redux-thunk';
const globalExceptionHandler = (error, isFatal) => { const globalExceptionHandler = (error, isFatal) => {
if (error && NativeModules.Firebase) { if (error && NativeModules.Firebase) {
console.log(error);
NativeModules.Firebase.logException(isFatal, error.message ? error.message : 'No message', JSON.stringify(error)); NativeModules.Firebase.logException(isFatal, error.message ? error.message : 'No message', JSON.stringify(error));
} }
}; };
@ -87,6 +89,7 @@ function enableBatching(reducer) {
const compressor = createCompressor(); const compressor = createCompressor();
const authFilter = createFilter('auth', ['authToken']); const authFilter = createFilter('auth', ['authToken']);
const blockedFilter = createFilter('blocked', ['blockedChannels']);
const contentFilter = createFilter('content', ['positions']); const contentFilter = createFilter('content', ['positions']);
const saveClaimsFilter = createFilter('claims', ['claimsByUri']); const saveClaimsFilter = createFilter('claims', ['claimsByUri']);
const subscriptionsFilter = createFilter('subscriptions', ['enabledChannelNotifications', 'subscriptions', 'latest']); const subscriptionsFilter = createFilter('subscriptions', ['enabledChannelNotifications', 'subscriptions', 'latest']);
@ -95,10 +98,18 @@ const tagsFilter = createFilter('tags', ['followedTags']);
const walletFilter = createFilter('wallet', ['receiveAddress']); const walletFilter = createFilter('wallet', ['receiveAddress']);
const v4PersistOptions = { const v4PersistOptions = {
whitelist: ['auth', 'claims', 'content', 'subscriptions', 'settings', 'tags', 'wallet'], whitelist: ['auth', 'blocked', 'claims', 'content', 'subscriptions', 'settings', 'tags', 'wallet'],
// Order is important. Needs to be compressed last or other transforms can't // Order is important. Needs to be compressed last or other transforms can't
// read the data // read the data
transforms: [authFilter, saveClaimsFilter, subscriptionsFilter, settingsFilter, walletFilter, compressor], transforms: [
authFilter,
blockedFilter,
saveClaimsFilter,
subscriptionsFilter,
settingsFilter,
walletFilter,
compressor,
],
debounce: 10000, debounce: 10000,
storage: FilesystemStorage, storage: FilesystemStorage,
}; };
@ -111,6 +122,7 @@ const persistOptions = Object.assign({}, v4PersistOptions, {
const reducers = persistCombineReducers(persistOptions, { const reducers = persistCombineReducers(persistOptions, {
auth: authReducer, auth: authReducer,
blacklist: blacklistReducer, blacklist: blacklistReducer,
blocked: blockedReducer,
claims: claimsReducer, claims: claimsReducer,
content: contentReducer, content: contentReducer,
costInfo: costInfoReducer, costInfo: costInfoReducer,
@ -141,6 +153,7 @@ const reducers = persistCombineReducers(persistOptions, {
const sharedStateActions = [ const sharedStateActions = [
LBRYINC_ACTIONS.CHANNEL_SUBSCRIBE, LBRYINC_ACTIONS.CHANNEL_SUBSCRIBE,
LBRYINC_ACTIONS.CHANNEL_UNSUBSCRIBE, LBRYINC_ACTIONS.CHANNEL_UNSUBSCRIBE,
LBRY_REDUX_ACTIONS.CREATE_CHANNEL_COMPLETED,
LBRY_REDUX_ACTIONS.TOGGLE_TAG_FOLLOW, LBRY_REDUX_ACTIONS.TOGGLE_TAG_FOLLOW,
LBRY_REDUX_ACTIONS.TOGGLE_BLOCK_CHANNEL, LBRY_REDUX_ACTIONS.TOGGLE_BLOCK_CHANNEL,
]; ];
@ -153,6 +166,7 @@ const sharedStateFilters = {
return value.map(({ uri }) => uri); return value.map(({ uri }) => uri);
}, },
}, },
blocked: { source: 'blocked', property: 'blockedChannels' },
}; };
const sharedStateCallback = ({ dispatch, getState }) => { const sharedStateCallback = ({ dispatch, getState }) => {

View file

@ -38,7 +38,7 @@ const perform = dispatch => ({
clearChannelFormState: () => dispatch(doClearChannelFormState()), clearChannelFormState: () => dispatch(doClearChannelFormState()),
createChannel: (name, amount, optionalParams) => dispatch(doCreateChannel(name, amount, optionalParams)), createChannel: (name, amount, optionalParams) => dispatch(doCreateChannel(name, amount, optionalParams)),
fetchChannelListMine: () => dispatch(doFetchChannelListMine()), fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
getSync: password => dispatch(doGetSync(password)), getSync: (password, callback) => dispatch(doGetSync(password, callback)),
updateChannel: params => dispatch(doUpdateChannel(params)), updateChannel: params => dispatch(doUpdateChannel(params)),
updateChannelFormState: data => dispatch(doUpdateChannelFormState(data)), updateChannelFormState: data => dispatch(doUpdateChannelFormState(data)),
pushDrawerStack: (routeName, params) => dispatch(doPushDrawerStack(routeName, params)), pushDrawerStack: (routeName, params) => dispatch(doPushDrawerStack(routeName, params)),

View file

@ -517,7 +517,7 @@ class FilePage extends React.PureComponent {
const { claim, notify } = this.props; const { claim, notify } = this.props;
if (claim) { if (claim) {
const { canonical_url: canonicalUrl, short_url: shortUrl, permanent_url: permanentUrl } = claim; const { canonical_url: canonicalUrl, short_url: shortUrl, permanent_url: permanentUrl } = claim;
const url = 'https://lbry.tv' + this.formatLbryUrlForWeb(canonicalUrl || shortUrl || permanentUrl); const url = 'https://open.lbry.com' + this.formatLbryUrlForWeb(canonicalUrl || shortUrl || permanentUrl);
NativeModules.UtilityModule.shareUrl(url); NativeModules.UtilityModule.shareUrl(url);
} }
}; };
@ -950,15 +950,23 @@ class FilePage extends React.PureComponent {
<View style={filePageStyle.largeButtonsRow}> <View style={filePageStyle.largeButtonsRow}>
<TouchableOpacity style={filePageStyle.largeButton} onPress={this.handleSharePress}> <TouchableOpacity style={filePageStyle.largeButton} onPress={this.handleSharePress}>
<Icon name={'share-alt'} size={24} style={filePageStyle.largeButtonIcon} /> <Icon name={'share-alt'} size={20} style={filePageStyle.largeButtonIcon} />
<Text style={filePageStyle.largeButtonText}>Share</Text> <Text style={filePageStyle.largeButtonText}>Share</Text>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity
style={filePageStyle.largeButton}
onPress={() => this.setState({ showTipView: true })}
>
<Icon name={'gift'} size={20} style={filePageStyle.largeButtonIcon} />
<Text style={filePageStyle.largeButtonText}>Tip</Text>
</TouchableOpacity>
<TouchableOpacity <TouchableOpacity
style={filePageStyle.largeButton} style={filePageStyle.largeButton}
onPress={() => Linking.openURL(`https://lbry.com/dmca/${claim.claim_id}`)} onPress={() => Linking.openURL(`https://lbry.com/dmca/${claim.claim_id}`)}
> >
<Icon name={'flag'} size={24} style={filePageStyle.largeButtonIcon} /> <Icon name={'flag'} size={20} style={filePageStyle.largeButtonIcon} />
<Text style={filePageStyle.largeButtonText}>Report</Text> <Text style={filePageStyle.largeButtonText}>Report</Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
@ -999,12 +1007,6 @@ class FilePage extends React.PureComponent {
onPress={this.onSaveFilePressed} onPress={this.onSaveFilePressed}
/> />
)} )}
<Button
style={[filePageStyle.actionButton, filePageStyle.tipButton]}
theme={'light'}
icon={'gift'}
onPress={() => this.setState({ showTipView: true })}
/>
{channelName && ( {channelName && (
<SubscribeButton <SubscribeButton
style={filePageStyle.actionButton} style={filePageStyle.actionButton}

View file

@ -43,7 +43,7 @@ const perform = dispatch => ({
authenticate: (appVersion, os, firebaseToken) => dispatch(doAuthenticate(appVersion, os, firebaseToken)), authenticate: (appVersion, os, firebaseToken) => dispatch(doAuthenticate(appVersion, os, firebaseToken)),
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)), setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
syncApply: (hash, data, password) => dispatch(doSyncApply(hash, data, password)), syncApply: (hash, data, password) => dispatch(doSyncApply(hash, data, password)),
getSync: password => dispatch(doGetSync(password)), getSync: (password, callback) => dispatch(doGetSync(password, callback)),
checkSync: () => dispatch(doCheckSync()), checkSync: () => dispatch(doCheckSync()),
notify: data => dispatch(doToast(data)), notify: data => dispatch(doToast(data)),
resendVerificationEmail: email => dispatch(doUserResendVerificationEmail(email)), resendVerificationEmail: email => dispatch(doUserResendVerificationEmail(email)),

View file

@ -30,7 +30,7 @@ const perform = dispatch => ({
checkSubscriptionsInit: () => dispatch(doCheckSubscriptionsInit()), checkSubscriptionsInit: () => dispatch(doCheckSubscriptionsInit()),
fetchRewardedContent: () => dispatch(doFetchRewardedContent()), fetchRewardedContent: () => dispatch(doFetchRewardedContent()),
fetchSubscriptions: callback => dispatch(doFetchMySubscriptions(callback)), fetchSubscriptions: callback => dispatch(doFetchMySubscriptions(callback)),
getSync: password => dispatch(doGetSync(password)), getSync: (password, callback) => dispatch(doGetSync(password, callback)),
notify: data => dispatch(doToast(data)), notify: data => dispatch(doToast(data)),
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)), setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
setEmailToVerify: email => dispatch(doUserEmailToVerify(email)), setEmailToVerify: email => dispatch(doUserEmailToVerify(email)),

View file

@ -91,9 +91,11 @@ class SplashScreen extends React.PureComponent {
// user is authenticated, navigate to the main view // user is authenticated, navigate to the main view
if (user.has_verified_email) { if (user.has_verified_email) {
NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(walletPassword => { NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(walletPassword => {
getSync(walletPassword); getSync(walletPassword, () => {
this.getUserSettings();
this.navigateToMain(); this.navigateToMain();
}); });
});
return; return;
} }
@ -108,10 +110,13 @@ class SplashScreen extends React.PureComponent {
doPreferenceGet( doPreferenceGet(
'shared', 'shared',
preference => { preference => {
console.log('***');
console.log(preference);
populateSharedUserState(preference); populateSharedUserState(preference);
}, },
error => { error => {
/* failed */ /* failed */
console.log(error);
} }
); );
}; };
@ -135,15 +140,14 @@ class SplashScreen extends React.PureComponent {
filteredOutpointsSubscribe(); filteredOutpointsSubscribe();
checkSubscriptionsInit(); checkSubscriptionsInit();
// get user settings interval
this.getUserSettings();
if (user && user.id && user.has_verified_email) { if (user && user.id && user.has_verified_email) {
// user already authenticated // user already authenticated
NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(walletPassword => { NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(walletPassword => {
getSync(walletPassword); getSync(walletPassword, err => {
this.getUserSettings();
this.navigateToMain(); this.navigateToMain();
}); });
});
} else { } else {
NativeModules.VersionInfo.getAppVersion().then(appVersion => { NativeModules.VersionInfo.getAppVersion().then(appVersion => {
NativeModules.Firebase.getMessagingToken().then(firebaseToken => { NativeModules.Firebase.getMessagingToken().then(firebaseToken => {

View file

@ -54,7 +54,7 @@ const select = state => ({
const perform = dispatch => ({ const perform = dispatch => ({
addUserEmail: email => dispatch(doUserEmailNew(email)), addUserEmail: email => dispatch(doUserEmailNew(email)),
addUserPhone: (phone, countryCode) => dispatch(doUserPhoneNew(phone, countryCode)), addUserPhone: (phone, countryCode) => dispatch(doUserPhoneNew(phone, countryCode)),
getSync: password => dispatch(doGetSync(password)), getSync: (password, callback) => dispatch(doGetSync(password, callback)),
checkSync: () => dispatch(doCheckSync()), checkSync: () => dispatch(doCheckSync()),
verifyPhone: verificationCode => dispatch(doUserPhoneVerify(verificationCode)), verifyPhone: verificationCode => dispatch(doUserPhoneVerify(verificationCode)),
notify: data => dispatch(doToast(data)), notify: data => dispatch(doToast(data)),

View file

@ -5,7 +5,7 @@ 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';
import { doCheckSync, doGetSync, selectUser, selectHasSyncedWallet } from 'lbryinc'; import { doCheckSync, doGetSync, selectUser, selectHasSyncedWallet } from 'lbryinc';
import Constants from 'constants'; import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
import WalletPage from './view'; import WalletPage from './view';
const select = state => ({ const select = state => ({
@ -21,7 +21,7 @@ const select = state => ({
const perform = dispatch => ({ const perform = dispatch => ({
checkSync: () => dispatch(doCheckSync()), checkSync: () => dispatch(doCheckSync()),
getSync: password => dispatch(doGetSync(password)), getSync: (password, callback) => dispatch(doGetSync(password, callback)),
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)), setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_WALLET)), pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_WALLET)),
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)), setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),

View file

@ -384,6 +384,7 @@ const filePageStyle = StyleSheet.create({
largeButton: { largeButton: {
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
marginRight: 48,
}, },
largeButtonIcon: { largeButtonIcon: {
color: Colors.DescriptionGrey, color: Colors.DescriptionGrey,
@ -396,8 +397,10 @@ const filePageStyle = StyleSheet.create({
largeButtonsRow: { largeButtonsRow: {
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
justifyContent: 'space-between', marginLeft: 20,
margin: 16, marginRight: 20,
marginTop: 12,
marginBottom: 12,
}, },
}); });