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

Allow Infinity duration for persistent toasts #37

Merged
merged 2 commits into from
Feb 22, 2021
Merged

Conversation

timolins
Copy link
Owner

@timolins timolins commented Feb 3, 2021

Fixes #36

@vercel
Copy link

vercel bot commented Feb 3, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/timo/react-hot-toast/dzgvjitvi
✅ Preview: https://react-hot-toast-git-persistent-toast.timo1.vercel.app

@github-actions
Copy link

github-actions bot commented Feb 3, 2021

size-limit report 📦

Path Size
dist/react-hot-toast.cjs.production.min.js 4.39 KB (+0.21% 🔺)
dist/react-hot-toast.esm.js 4.34 KB (+0.3% 🔺)

@@ -14,6 +14,10 @@ export const useToaster = (toastOptions?: DefaultToastOptions) => {

const now = Date.now();
const timeouts = toasts.map((t) => {
if (t.duration === -1) {
Copy link

Choose a reason for hiding this comment

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

Wouldn't Infinity make this more clear?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Great suggestion, thanks.

@timolins timolins changed the title Allow -1 duration for persistent toasts Allow Infinity duration for persistent toasts Feb 13, 2021
@timolins timolins merged commit 3e2c069 into main Feb 22, 2021
@timolins timolins deleted the persistent-toast branch February 22, 2021 13:51
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.

Add persistent toasts
2 participants