Skip to content

bug: Promise success clears when 2nd promise has undefined success #1110

@hufftheweevil

Description

@hufftheweevil

What is the current behavior?

When calling two promises in a row, if one has a success defined, but the other does not, then the first one closes instantly. Example:

await toast.promise(async () => {}, {
  success: 'Success on 1'
})
await toast.promise(async () => {}, {
  // success: 'Success on 2',
  error: 'Error on 2'
})

If you uncomment the success on the 2nd one, then all works well.


What is the expected behavior?

success shouldn't be required. When absent, it shouldn't affect other toasts.

Note: Adding a toastId does not help.


Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

React v18.2.0; not tested in other versions
Tested in Chrome and Firefox

BTW, awesome package! Simple and beautiful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions