Handle settings errors

This commit is contained in:
Ildar Kamalov
2018-09-14 16:41:34 +03:00
parent 828bb40084
commit 22a5abb7b8
2 changed files with 52 additions and 53 deletions

View File

@@ -3,9 +3,11 @@ import PropTypes from 'prop-types';
class Toast extends Component {
componentDidMount() {
const timeoutTime = this.props.type === 'error' ? 30000 : 5000;
setTimeout(() => {
this.props.removeToast(this.props.id);
}, 30000);
}, timeoutTime);
}
shouldComponentUpdate() {