Skip to content

Commit

Permalink
Fixed bug where new timeout prop passed to toastr update was ignored (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tgreen7 authored and giladgray committed Nov 27, 2018
1 parent 2dc2d1f commit 84178ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/src/components/toast/toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ export class Toast extends AbstractPureComponent<IToastProps, {}> {
}

public componentDidUpdate(prevProps: IToastProps) {
if (prevProps.timeout <= 0 && this.props.timeout > 0) {
if (prevProps.timeout !== this.props.timeout && this.props.timeout > 0) {
this.startTimeout();
} else if (prevProps.timeout <= 0 && this.props.timeout > 0) {
this.startTimeout();
} else if (prevProps.timeout > 0 && this.props.timeout <= 0) {
this.clearTimeouts();
Expand Down

0 comments on commit 84178ec

Please sign in to comment.