Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issues in toastr timeouts #3244

Closed
wants to merge 1 commit into from
Closed

Conversation

tgreen7
Copy link
Contributor

@tgreen7 tgreen7 commented Dec 14, 2018

Fixes #0000

Checklist

  • Includes tests
  • Update documentation

Changes proposed in this pull request:

I recently pushed a change to fix an issue with toasts where new timeout props were getting ignored. Now I just found a similar issue where the old timeout would still trigger and clear the toast anyways.

Separately why is the third condition to clearTimeouts. That would make the toastr stay forever. Shouldn't it just trigger the dismiss immediately?

Copy link
Contributor

@giladgray giladgray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tgreen7 sorry for leaving this hanging for so long. poked at it today and I disagree with the fundamentals here so I have opened #3275 with a cleaner approach. check it out and let me know what you think.

this.startTimeout();
} else if (prevProps.timeout <= 0 && this.props.timeout > 0) {
this.startTimeout();
} else if (prevProps.timeout > 0 && this.props.timeout <= 0) {
this.clearTimeouts();
this.triggerDismiss(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not the desired behavior -- setting timeout to 200 and then to 0 should never dismiss that toast.

@giladgray giladgray closed this Jan 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants