Fix timeout

This commit is contained in:
Ildar Kamalov 2018-09-14 16:43:27 +03:00
parent 22a5abb7b8
commit d237df6389
1 changed files with 2 additions and 2 deletions

View File

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