fix: Fixed issue where file upload toast would close before completion if you switched windows

This commit is contained in:
Aman Harwara
2023-01-05 00:13:42 +05:30
parent 81ea9e896c
commit 30dda73e90

View File

@@ -27,8 +27,12 @@ export const ToastTimer: FunctionComponent<Props> = ({ toast, index }) => {
const remainingTimeRef = useRef(duration)
const dismissToastOnEnd = useCallback(() => {
if (!shouldAutoClose) {
return
}
dismissToast(toast.id)
}, [toast.id])
}, [shouldAutoClose, toast.id])
const clearTimer = useCallback(() => {
if (toastTimerIdRef.current) {