diff --git a/app/package-lock.json b/app/package-lock.json index fc54fa68..ffcf8e98 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -3982,19 +3982,37 @@ } }, "lbry-redux": { - "version": "github:lbryio/lbry-redux#30af6b5483fd74d66082316c621b761853d1419a", - "from": "github:lbryio/lbry-redux#pre-notification-update", + "version": "github:lbryio/lbry-redux#1ed2ea8b2de99bbcba652aa7b00478d02df4a290", + "from": "github:lbryio/lbry-redux", "requires": { "proxy-polyfill": "0.1.6", - "reselect": "^3.0.0" + "reselect": "^3.0.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + } } }, "lbryinc": { - "version": "github:lbryio/lbryinc#ef0fd224a2ed2863a8b512207d46f149747d3e68", - "from": "github:lbryio/lbryinc#daemon-0.30.1-rc", + "version": "github:lbryio/lbryinc#82308ece97188747adbf6d71d55b6e7a6fa0bd95", + "from": "github:lbryio/lbryinc", "requires": { - "lbry-redux": "github:lbryio/lbry-redux#30af6b5483fd74d66082316c621b761853d1419a", + "lbry-redux": "github:lbryio/lbry-redux#2375860d6269d0369418879c2531b1d48c4e47f2", "reselect": "^3.0.0" + }, + "dependencies": { + "lbry-redux": { + "version": "github:lbryio/lbry-redux#2375860d6269d0369418879c2531b1d48c4e47f2", + "from": "github:lbryio/lbry-redux#2375860d6269d0369418879c2531b1d48c4e47f2", + "requires": { + "proxy-polyfill": "0.1.6", + "reselect": "^3.0.0" + } + } } }, "lcid": { diff --git a/app/package.json b/app/package.json index f1d48afa..3e0a86e2 100644 --- a/app/package.json +++ b/app/package.json @@ -7,8 +7,8 @@ }, "dependencies": { "base-64": "^0.1.0", - "lbry-redux": "lbryio/lbry-redux#pre-notification-update", - "lbryinc": "lbryio/lbryinc#daemon-0.30.1-rc", + "lbry-redux": "lbryio/lbry-redux", + "lbryinc": "lbryio/lbryinc", "moment": "^2.22.1", "react": "16.2.0", "react-native": "0.55.3", diff --git a/app/src/component/AppNavigator.js b/app/src/component/AppNavigator.js index 2efe153b..92bc1e60 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, doDismissToast, doToast, selectToast } from 'lbry-redux'; import { doUserEmailVerify, doUserEmailVerifyFailure, @@ -240,28 +240,16 @@ 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++) { - const type = displayType[i]; - if (AppWithNavigationState.supportedDisplayTypes.indexOf(type) > -1) { - currentDisplayType = type; - break; - } - } - } else if (AppWithNavigationState.supportedDisplayTypes.indexOf(displayType) > -1) { - currentDisplayType = displayType; - } - if (!currentDisplayType && message) { // default to toast if no display type set and there is a message specified currentDisplayType = 'toast'; @@ -271,7 +259,7 @@ class AppWithNavigationState extends React.Component { ToastAndroid.show(message, ToastAndroid.LONG); } - dispatch(doHideNotification()); + dispatch(doDismissToast()); } if (user && @@ -287,7 +275,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 +328,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 +350,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 || ''}