diff --git a/package-lock.json b/package-lock.json index 81cc5c6..0cc3e74 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5640,8 +5640,8 @@ } }, "lbry-redux": { - "version": "github:lbryio/lbry-redux#123efacf4d45289ebda9dc291976d475de227a55", - "from": "github:lbryio/lbry-redux#123efacf4d45289ebda9dc291976d475de227a55", + "version": "github:lbryio/lbry-redux#d44cd9ca56dee784dba42c0cc13061ae75cbd46c", + "from": "github:lbryio/lbry-redux#d44cd9ca56dee784dba42c0cc13061ae75cbd46c", "requires": { "proxy-polyfill": "0.1.6", "reselect": "^3.0.0", @@ -5649,8 +5649,8 @@ } }, "lbryinc": { - "version": "github:lbryio/lbryinc#b9f354ae50bd57691765a7d042c5054167878bf4", - "from": "github:lbryio/lbryinc#b9f354ae50bd57691765a7d042c5054167878bf4", + "version": "github:lbryio/lbryinc#d250096a6fc5df16be4f82812ecce28d6e558b6e", + "from": "github:lbryio/lbryinc#d250096a6fc5df16be4f82812ecce28d6e558b6e", "requires": { "reselect": "^3.0.0" } diff --git a/package.json b/package.json index 57d482b..9a434c5 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,8 @@ "base-64": "^0.1.0", "@expo/vector-icons": "^8.1.0", "gfycat-style-urls": "^1.0.3", - "lbry-redux": "lbryio/lbry-redux#123efacf4d45289ebda9dc291976d475de227a55", - "lbryinc": "lbryio/lbryinc#b9f354ae50bd57691765a7d042c5054167878bf4", + "lbry-redux": "lbryio/lbry-redux#d44cd9ca56dee784dba42c0cc13061ae75cbd46c", + "lbryinc": "lbryio/lbryinc#d250096a6fc5df16be4f82812ecce28d6e558b6e", "lodash": ">=4.17.11", "merge": ">=1.2.1", "moment": "^2.22.1", diff --git a/src/assets/gerbil-happy.png b/src/assets/gerbil-happy.png new file mode 100644 index 0000000..4247f83 Binary files /dev/null and b/src/assets/gerbil-happy.png differ diff --git a/src/assets/gerbil-sad.png b/src/assets/gerbil-sad.png new file mode 100644 index 0000000..153d4ad Binary files /dev/null and b/src/assets/gerbil-sad.png differ diff --git a/src/component/AppNavigator.js b/src/component/AppNavigator.js index db24edb..a5fb642 100644 --- a/src/component/AppNavigator.js +++ b/src/component/AppNavigator.js @@ -29,8 +29,9 @@ import { import { connect } from 'react-redux'; import { AppState, BackHandler, Linking, NativeModules, TextInput, ToastAndroid } from 'react-native'; import { selectDrawerStack } from 'redux/selectors/drawer'; -import { SETTINGS, doDismissToast, doToast, selectToast } from 'lbry-redux'; +import { SETTINGS, doDismissToast, doPopulateSharedUserState, doToast, selectToast } from 'lbry-redux'; import { + Lbryio, doGetSync, doUserCheckEmailVerified, doUserEmailVerify, @@ -305,6 +306,13 @@ class AppWithNavigationState extends React.Component { }); }; + getUserSettings = () => { + const { dispatch } = this.props; + Lbryio.call('user_settings', 'get').then(settings => { + dispatch(doPopulateSharedUserState(settings)); + }); + }; + componentWillUnmount() { AppState.removeEventListener('change', this._handleAppStateChange); BackHandler.removeEventListener('hardwareBackPress'); @@ -321,12 +329,8 @@ class AppWithNavigationState extends React.Component { NativeModules.Firebase.track('email_verified', { email: user.primary_email }); ToastAndroid.show('Your email address was successfully verified.', ToastAndroid.LONG); - // upon successful email verification, do wallet sync (if password has been set) - NativeModules.UtilityModule.getSecureValue(Constants.KEY_FIRST_RUN_PASSWORD).then(walletPassword => { - if (walletPassword && walletPassword.trim().length > 0) { - dispatch(doGetSync(walletPassword)); - } - }); + // get user settings after email verification + this.getUserSettings(); } } diff --git a/src/component/channelSelector/view.js b/src/component/channelSelector/view.js index e5e8c29..b8d81a8 100644 --- a/src/component/channelSelector/view.js +++ b/src/component/channelSelector/view.js @@ -26,8 +26,8 @@ export default class ChannelSelector extends React.PureComponent { } componentDidMount() { - const { channels, channelName, fetchChannelListMine, fetchingChannels } = this.props; - if (!channels.length && !fetchingChannels) { + const { channels = [], channelName, fetchChannelListMine, fetchingChannels } = this.props; + if ((!channels || channels.length === 0) && !fetchingChannels) { fetchChannelListMine(); } this.setState({ currentSelectedValue: channelName }); @@ -37,7 +37,7 @@ export default class ChannelSelector extends React.PureComponent { const { channels: prevChannels = [], channelName } = this.props; const { channels = [] } = nextProps; - if (channels.length !== prevChannels.length && channelName !== this.state.currentSelectedValue) { + if (channels && channels.length !== prevChannels.length && channelName !== this.state.currentSelectedValue) { this.setState({ currentSelectedValue: channelName }); } } @@ -182,7 +182,9 @@ export default class ChannelSelector extends React.PureComponent { render() { const channel = this.state.addingChannel ? 'new' : this.props.channel; const { enabled, fetchingChannels, channels = [] } = this.props; - const pickerItems = [Constants.ITEM_ANONYMOUS, Constants.ITEM_CREATE_A_CHANNEL].concat(channels.map(ch => ch.name)); + const pickerItems = [Constants.ITEM_ANONYMOUS, Constants.ITEM_CREATE_A_CHANNEL].concat( + channels ? channels.map(ch => ch.name) : [] + ); const { newChannelName, diff --git a/src/component/emptyStateView/index.js b/src/component/emptyStateView/index.js new file mode 100644 index 0000000..53e1c84 --- /dev/null +++ b/src/component/emptyStateView/index.js @@ -0,0 +1,4 @@ +import { connect } from 'react-redux'; +import EmptyStateView from './view'; + +export default connect()(EmptyStateView); diff --git a/src/component/emptyStateView/view.js b/src/component/emptyStateView/view.js new file mode 100644 index 0000000..e69ceda --- /dev/null +++ b/src/component/emptyStateView/view.js @@ -0,0 +1,26 @@ +import React from 'react'; +import { NativeModules, Text, View, Image, TouchableOpacity } from 'react-native'; +import Button from '../button'; +import emptyStateStyle from 'styles/emptyState'; + +class EmptyStateView extends React.PureComponent { + render() { + const { message, buttonText, inner, onButtonPress } = this.props; + + return ( + + + {message} + {buttonText && ( + +