fix: Fixed issue where file upload toast would close before completion if you switched windows
This commit is contained in:
@@ -27,8 +27,12 @@ export const ToastTimer: FunctionComponent<Props> = ({ toast, index }) => {
|
|||||||
const remainingTimeRef = useRef(duration)
|
const remainingTimeRef = useRef(duration)
|
||||||
|
|
||||||
const dismissToastOnEnd = useCallback(() => {
|
const dismissToastOnEnd = useCallback(() => {
|
||||||
|
if (!shouldAutoClose) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
dismissToast(toast.id)
|
dismissToast(toast.id)
|
||||||
}, [toast.id])
|
}, [shouldAutoClose, toast.id])
|
||||||
|
|
||||||
const clearTimer = useCallback(() => {
|
const clearTimer = useCallback(() => {
|
||||||
if (toastTimerIdRef.current) {
|
if (toastTimerIdRef.current) {
|
||||||
|
|||||||
Reference in New Issue
Block a user