diff --git a/app/src/component/AppNavigator.js b/app/src/component/AppNavigator.js index 2efe153b..16603008 100644 --- a/app/src/component/AppNavigator.js +++ b/app/src/component/AppNavigator.js @@ -33,7 +33,7 @@ import { ToastAndroid } from 'react-native'; import { doDeleteCompleteBlobs } from '../redux/actions/file'; -import { SETTINGS, doHideNotification, doNotify, selectNotification } from 'lbry-redux'; +import { SETTINGS, doHideNotification, doToast, selectToast } from 'lbry-redux'; import { doUserEmailVerify, doUserEmailVerifyFailure, @@ -240,15 +240,15 @@ class AppWithNavigationState extends React.Component { componentWillUpdate(nextProps) { const { dispatch } = this.props; const { - notification, + toast, emailToVerify, emailVerifyPending, emailVerifyErrorMessage, user } = nextProps; - if (notification) { - const { displayType, message } = notification; + if (toast) { + const { message } = toast; let currentDisplayType; if (displayType && displayType.length) { for (let i = 0; i < displayType.length; i++) { @@ -287,7 +287,7 @@ class AppWithNavigationState extends React.Component { AsyncStorage.removeItem(Constants.KEY_FIRST_RUN_EMAIL); } AsyncStorage.removeItem(Constants.KEY_SHOULD_VERIFY_EMAIL); - dispatch(doNotify({ message, displayType: ['toast'] })); + dispatch(doToast({ message })); } }); } @@ -340,12 +340,11 @@ class AppWithNavigationState extends React.Component { } catch (error) { const message = 'Invalid Verification Token'; dispatch(doUserEmailVerifyFailure(message)); - dispatch(doNotify({ message, displayType: ['toast'] })); + dispatch(doToast({ message })); } } else { - dispatch(doNotify({ + dispatch(doToast({ message: 'Invalid Verification URI', - displayType: ['toast'], })); } } else { @@ -363,7 +362,7 @@ const mapStateToProps = state => ({ backgroundPlayEnabled: makeSelectClientSetting(SETTINGS.BACKGROUND_PLAY_ENABLED)(state), keepDaemonRunning: makeSelectClientSetting(SETTINGS.KEEP_DAEMON_RUNNING)(state), nav: state.nav, - notification: selectNotification(state), + toast: selectToast(state), emailToVerify: selectEmailToVerify(state), emailVerifyPending: selectEmailVerifyIsPending(state), emailVerifyErrorMessage: selectEmailVerifyErrorMessage(state), diff --git a/app/src/component/address/index.js b/app/src/component/address/index.js index 9aaa4a3b..fea1b6ce 100644 --- a/app/src/component/address/index.js +++ b/app/src/component/address/index.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux'; -import { doNotify } from 'lbry-redux'; +import { doToast } from 'lbry-redux'; import Address from './view'; export default connect(null, { - doNotify, + doToast, })(Address); diff --git a/app/src/component/address/view.js b/app/src/component/address/view.js index 1730dd27..6562bb39 100644 --- a/app/src/component/address/view.js +++ b/app/src/component/address/view.js @@ -6,21 +6,20 @@ import walletStyle from '../../styles/wallet'; type Props = { address: string, - doNotify: ({ message: string, displayType: Array }) => void, + doToast: ({ message: string }) => void, }; export default class Address extends React.PureComponent { render() { - const { address, doNotify, style } = this.props; - + const { address, doToast, style } = this.props; + return ( {address || ''}