Clean up toast logic in App.jsx
This commit is contained in:
@ -46,14 +46,9 @@ export default contain(
|
|||||||
toast: PropTypes.object
|
toast: PropTypes.object
|
||||||
},
|
},
|
||||||
|
|
||||||
componentWillReceiveProps({ toast: nextToast }) {
|
componentWillReceiveProps({ toast: nextToast = {} }) {
|
||||||
const { toast = {} } = this.props;
|
const { toast = {} } = this.props;
|
||||||
if (
|
if (toast.id !== nextToast.id) {
|
||||||
toast &&
|
|
||||||
nextToast &&
|
|
||||||
toast.id !== nextToast.id
|
|
||||||
) {
|
|
||||||
|
|
||||||
this.refs.toaster[nextToast.type || 'success'](
|
this.refs.toaster[nextToast.type || 'success'](
|
||||||
nextToast.message,
|
nextToast.message,
|
||||||
nextToast.title,
|
nextToast.title,
|
||||||
|
Reference in New Issue
Block a user