Fix timeout
This commit is contained in:
parent
22a5abb7b8
commit
d237df6389
|
@ -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() {
|
||||||
|
|
Loading…
Reference in New Issue