more updates for release
This commit is contained in:
parent
eb12a361b7
commit
48030a97f2
13 changed files with 62 additions and 32 deletions
4
package-lock.json
generated
4
package-lock.json
generated
|
@ -5640,8 +5640,8 @@
|
|||
}
|
||||
},
|
||||
"lbry-redux": {
|
||||
"version": "github:lbryio/lbry-redux#98723e0c3cc48340d5a1c7100700fcae69298a2e",
|
||||
"from": "github:lbryio/lbry-redux#98723e0c3cc48340d5a1c7100700fcae69298a2e",
|
||||
"version": "github:lbryio/lbry-redux#9919a8150998822ca997cd23418f023d64d4a3da",
|
||||
"from": "github:lbryio/lbry-redux#9919a8150998822ca997cd23418f023d64d4a3da",
|
||||
"requires": {
|
||||
"proxy-polyfill": "0.1.6",
|
||||
"reselect": "^3.0.0",
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"base-64": "^0.1.0",
|
||||
"@expo/vector-icons": "^8.1.0",
|
||||
"gfycat-style-urls": "^1.0.3",
|
||||
"lbry-redux": "lbryio/lbry-redux#98723e0c3cc48340d5a1c7100700fcae69298a2e",
|
||||
"lbry-redux": "lbryio/lbry-redux#9919a8150998822ca997cd23418f023d64d4a3da",
|
||||
"lbryinc": "lbryio/lbryinc#aebad10a9c5d725c3fedae4236d56f239a0bc1de",
|
||||
"lodash": ">=4.17.11",
|
||||
"merge": ">=1.2.1",
|
||||
|
|
|
@ -272,6 +272,7 @@ class AppWithNavigationState extends React.Component {
|
|||
constructor() {
|
||||
super();
|
||||
this.emailVerifyCheckInterval = null;
|
||||
this.syncGetInterval = null;
|
||||
this.state = {
|
||||
emailVerifyDone: false,
|
||||
verifyPending: false,
|
||||
|
@ -301,10 +302,10 @@ class AppWithNavigationState extends React.Component {
|
|||
Linking.addEventListener('url', this._handleUrl);
|
||||
|
||||
// call /sync/get with interval
|
||||
setInterval(() => {
|
||||
this.syncGetInterval = setInterval(() => {
|
||||
this.setState({ syncHashChanged: false }); // reset local state
|
||||
NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(walletPassword => {
|
||||
dispatch(doGetSync(walletPassword));
|
||||
dispatch(doGetSync(walletPassword, () => this.getUserSettings()));
|
||||
});
|
||||
}, SYNC_GET_INTERVAL);
|
||||
}
|
||||
|
@ -336,6 +337,12 @@ class AppWithNavigationState extends React.Component {
|
|||
AppState.removeEventListener('change', this._handleAppStateChange);
|
||||
BackHandler.removeEventListener('hardwareBackPress');
|
||||
Linking.removeEventListener('url', this._handleUrl);
|
||||
if (this.emailVerifyCheckInterval > -1) {
|
||||
clearInterval(this.emailVerifyCheckInterval);
|
||||
}
|
||||
if (this.syncGetInterval > -1) {
|
||||
clearInterval(this.syncGetInterval);
|
||||
}
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
|
|
|
@ -20,7 +20,7 @@ const perform = dispatch => ({
|
|||
notify: data => dispatch(doToast(data)),
|
||||
createChannel: (name, amount) => dispatch(doCreateChannel(name, amount)),
|
||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
||||
getSync: password => dispatch(doGetSync(password)),
|
||||
getSync: (password, callback) => dispatch(doGetSync(password, callback)),
|
||||
});
|
||||
|
||||
export default connect(
|
||||
|
|
18
src/index.js
18
src/index.js
|
@ -5,6 +5,7 @@ import { AppRegistry, Text, View, NativeModules } from 'react-native';
|
|||
import {
|
||||
Lbry,
|
||||
buildSharedStateMiddleware,
|
||||
blockedReducer,
|
||||
claimsReducer,
|
||||
contentReducer,
|
||||
fileReducer,
|
||||
|
@ -52,6 +53,7 @@ import thunk from 'redux-thunk';
|
|||
|
||||
const globalExceptionHandler = (error, isFatal) => {
|
||||
if (error && NativeModules.Firebase) {
|
||||
console.log(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 authFilter = createFilter('auth', ['authToken']);
|
||||
const blockedFilter = createFilter('blocked', ['blockedChannels']);
|
||||
const contentFilter = createFilter('content', ['positions']);
|
||||
const saveClaimsFilter = createFilter('claims', ['claimsByUri']);
|
||||
const subscriptionsFilter = createFilter('subscriptions', ['enabledChannelNotifications', 'subscriptions', 'latest']);
|
||||
|
@ -95,10 +98,18 @@ const tagsFilter = createFilter('tags', ['followedTags']);
|
|||
const walletFilter = createFilter('wallet', ['receiveAddress']);
|
||||
|
||||
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
|
||||
// read the data
|
||||
transforms: [authFilter, saveClaimsFilter, subscriptionsFilter, settingsFilter, walletFilter, compressor],
|
||||
transforms: [
|
||||
authFilter,
|
||||
blockedFilter,
|
||||
saveClaimsFilter,
|
||||
subscriptionsFilter,
|
||||
settingsFilter,
|
||||
walletFilter,
|
||||
compressor,
|
||||
],
|
||||
debounce: 10000,
|
||||
storage: FilesystemStorage,
|
||||
};
|
||||
|
@ -111,6 +122,7 @@ const persistOptions = Object.assign({}, v4PersistOptions, {
|
|||
const reducers = persistCombineReducers(persistOptions, {
|
||||
auth: authReducer,
|
||||
blacklist: blacklistReducer,
|
||||
blocked: blockedReducer,
|
||||
claims: claimsReducer,
|
||||
content: contentReducer,
|
||||
costInfo: costInfoReducer,
|
||||
|
@ -141,6 +153,7 @@ const reducers = persistCombineReducers(persistOptions, {
|
|||
const sharedStateActions = [
|
||||
LBRYINC_ACTIONS.CHANNEL_SUBSCRIBE,
|
||||
LBRYINC_ACTIONS.CHANNEL_UNSUBSCRIBE,
|
||||
LBRY_REDUX_ACTIONS.CREATE_CHANNEL_COMPLETED,
|
||||
LBRY_REDUX_ACTIONS.TOGGLE_TAG_FOLLOW,
|
||||
LBRY_REDUX_ACTIONS.TOGGLE_BLOCK_CHANNEL,
|
||||
];
|
||||
|
@ -153,6 +166,7 @@ const sharedStateFilters = {
|
|||
return value.map(({ uri }) => uri);
|
||||
},
|
||||
},
|
||||
blocked: { source: 'blocked', property: 'blockedChannels' },
|
||||
};
|
||||
|
||||
const sharedStateCallback = ({ dispatch, getState }) => {
|
||||
|
|
|
@ -38,7 +38,7 @@ const perform = dispatch => ({
|
|||
clearChannelFormState: () => dispatch(doClearChannelFormState()),
|
||||
createChannel: (name, amount, optionalParams) => dispatch(doCreateChannel(name, amount, optionalParams)),
|
||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
||||
getSync: password => dispatch(doGetSync(password)),
|
||||
getSync: (password, callback) => dispatch(doGetSync(password, callback)),
|
||||
updateChannel: params => dispatch(doUpdateChannel(params)),
|
||||
updateChannelFormState: data => dispatch(doUpdateChannelFormState(data)),
|
||||
pushDrawerStack: (routeName, params) => dispatch(doPushDrawerStack(routeName, params)),
|
||||
|
|
|
@ -517,7 +517,7 @@ class FilePage extends React.PureComponent {
|
|||
const { claim, notify } = this.props;
|
||||
if (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);
|
||||
}
|
||||
};
|
||||
|
@ -950,15 +950,23 @@ class FilePage extends React.PureComponent {
|
|||
|
||||
<View style={filePageStyle.largeButtonsRow}>
|
||||
<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>
|
||||
</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
|
||||
style={filePageStyle.largeButton}
|
||||
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>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
|
@ -999,12 +1007,6 @@ class FilePage extends React.PureComponent {
|
|||
onPress={this.onSaveFilePressed}
|
||||
/>
|
||||
)}
|
||||
<Button
|
||||
style={[filePageStyle.actionButton, filePageStyle.tipButton]}
|
||||
theme={'light'}
|
||||
icon={'gift'}
|
||||
onPress={() => this.setState({ showTipView: true })}
|
||||
/>
|
||||
{channelName && (
|
||||
<SubscribeButton
|
||||
style={filePageStyle.actionButton}
|
||||
|
|
|
@ -43,7 +43,7 @@ const perform = dispatch => ({
|
|||
authenticate: (appVersion, os, firebaseToken) => dispatch(doAuthenticate(appVersion, os, firebaseToken)),
|
||||
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
||||
syncApply: (hash, data, password) => dispatch(doSyncApply(hash, data, password)),
|
||||
getSync: password => dispatch(doGetSync(password)),
|
||||
getSync: (password, callback) => dispatch(doGetSync(password, callback)),
|
||||
checkSync: () => dispatch(doCheckSync()),
|
||||
notify: data => dispatch(doToast(data)),
|
||||
resendVerificationEmail: email => dispatch(doUserResendVerificationEmail(email)),
|
||||
|
|
|
@ -30,7 +30,7 @@ const perform = dispatch => ({
|
|||
checkSubscriptionsInit: () => dispatch(doCheckSubscriptionsInit()),
|
||||
fetchRewardedContent: () => dispatch(doFetchRewardedContent()),
|
||||
fetchSubscriptions: callback => dispatch(doFetchMySubscriptions(callback)),
|
||||
getSync: password => dispatch(doGetSync(password)),
|
||||
getSync: (password, callback) => dispatch(doGetSync(password, callback)),
|
||||
notify: data => dispatch(doToast(data)),
|
||||
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
||||
setEmailToVerify: email => dispatch(doUserEmailToVerify(email)),
|
||||
|
|
|
@ -91,8 +91,10 @@ class SplashScreen extends React.PureComponent {
|
|||
// 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.navigateToMain();
|
||||
getSync(walletPassword, () => {
|
||||
this.getUserSettings();
|
||||
this.navigateToMain();
|
||||
});
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
@ -108,10 +110,13 @@ class SplashScreen extends React.PureComponent {
|
|||
doPreferenceGet(
|
||||
'shared',
|
||||
preference => {
|
||||
console.log('***');
|
||||
console.log(preference);
|
||||
populateSharedUserState(preference);
|
||||
},
|
||||
error => {
|
||||
/* failed */
|
||||
console.log(error);
|
||||
}
|
||||
);
|
||||
};
|
||||
|
@ -135,14 +140,13 @@ class SplashScreen extends React.PureComponent {
|
|||
filteredOutpointsSubscribe();
|
||||
checkSubscriptionsInit();
|
||||
|
||||
// get user settings interval
|
||||
this.getUserSettings();
|
||||
|
||||
if (user && user.id && user.has_verified_email) {
|
||||
// user already authenticated
|
||||
NativeModules.UtilityModule.getSecureValue(Constants.KEY_WALLET_PASSWORD).then(walletPassword => {
|
||||
getSync(walletPassword);
|
||||
this.navigateToMain();
|
||||
getSync(walletPassword, err => {
|
||||
this.getUserSettings();
|
||||
this.navigateToMain();
|
||||
});
|
||||
});
|
||||
} else {
|
||||
NativeModules.VersionInfo.getAppVersion().then(appVersion => {
|
||||
|
|
|
@ -54,7 +54,7 @@ const select = state => ({
|
|||
const perform = dispatch => ({
|
||||
addUserEmail: email => dispatch(doUserEmailNew(email)),
|
||||
addUserPhone: (phone, countryCode) => dispatch(doUserPhoneNew(phone, countryCode)),
|
||||
getSync: password => dispatch(doGetSync(password)),
|
||||
getSync: (password, callback) => dispatch(doGetSync(password, callback)),
|
||||
checkSync: () => dispatch(doCheckSync()),
|
||||
verifyPhone: verificationCode => dispatch(doUserPhoneVerify(verificationCode)),
|
||||
notify: data => dispatch(doToast(data)),
|
||||
|
|
|
@ -5,7 +5,7 @@ import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
|
|||
import { selectCurrentRoute } from 'redux/selectors/drawer';
|
||||
import { selectBalance } from 'lbry-redux';
|
||||
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';
|
||||
|
||||
const select = state => ({
|
||||
|
@ -21,7 +21,7 @@ const select = state => ({
|
|||
|
||||
const perform = dispatch => ({
|
||||
checkSync: () => dispatch(doCheckSync()),
|
||||
getSync: password => dispatch(doGetSync(password)),
|
||||
getSync: (password, callback) => dispatch(doGetSync(password, callback)),
|
||||
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
||||
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_WALLET)),
|
||||
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
|
||||
|
|
|
@ -384,6 +384,7 @@ const filePageStyle = StyleSheet.create({
|
|||
largeButton: {
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
marginRight: 48,
|
||||
},
|
||||
largeButtonIcon: {
|
||||
color: Colors.DescriptionGrey,
|
||||
|
@ -396,8 +397,10 @@ const filePageStyle = StyleSheet.create({
|
|||
largeButtonsRow: {
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-between',
|
||||
margin: 16,
|
||||
marginLeft: 20,
|
||||
marginRight: 20,
|
||||
marginTop: 12,
|
||||
marginBottom: 12,
|
||||
},
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue