Skip to content

Commit 84178ec

Browse files
tgreen7giladgray
authored andcommitted
Fixed bug where new timeout prop passed to toastr update was ignored (#3164)
1 parent 2dc2d1f commit 84178ec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/core/src/components/toast/toast.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ export class Toast extends AbstractPureComponent<IToastProps, {}> {
7979
}
8080

8181
public componentDidUpdate(prevProps: IToastProps) {
82-
if (prevProps.timeout <= 0 && this.props.timeout > 0) {
82+
if (prevProps.timeout !== this.props.timeout && this.props.timeout > 0) {
83+
this.startTimeout();
84+
} else if (prevProps.timeout <= 0 && this.props.timeout > 0) {
8385
this.startTimeout();
8486
} else if (prevProps.timeout > 0 && this.props.timeout <= 0) {
8587
this.clearTimeouts();

0 commit comments

Comments
 (0)