Closed b-graves closed 10 months ago
We have the following code to show and hide a Toast
const loadingId = toast.show({ title: '...', text: '...', color: 'neutral', icon: <Loader color="primary" />, timeout: 0, }) await dispatch( update(something) ) toast.hide(loadingId)
However if the promise rejects immediately then it seems that the hide.toast is missed as the Toast remains
hide.toast
If we add a setTimeout then the toast is hidden, pressumably because following this the Toast has completed being shown so is ready to be hidden:
setTimeout
const loadingId = toast.show({ title: '...', text: '...', color: 'neutral', icon: <Loader color="primary" />, timeout: 0, }) await dispatch( update(something) ) setTimeout(() => toast.hide(loadingId), 3000)
Hey, thanks for reporting this, I'll add this to the backlog for the upcoming release
Fixed, coming in the next release
We have the following code to show and hide a Toast
However if the promise rejects immediately then it seems that the
hide.toast
is missed as the Toast remainsIf we add a
setTimeout
then the toast is hidden, pressumably because following this the Toast has completed being shown so is ready to be hidden: