|
@@ -113,6 +113,8 @@ const SnackBar: FC<ISnackBarProps> = ({
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
|
|
+ let timeout: NodeJS.Timeout;
|
|
|
|
|
+
|
|
|
if(isMeasured) {
|
|
if(isMeasured) {
|
|
|
transformAnim.setValue(-contentHeight.current + -top + -spaces.spacingSm);
|
|
transformAnim.setValue(-contentHeight.current + -top + -spaces.spacingSm);
|
|
|
|
|
|
|
@@ -131,10 +133,16 @@ const SnackBar: FC<ISnackBarProps> = ({
|
|
|
})
|
|
})
|
|
|
]).start();
|
|
]).start();
|
|
|
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
|
|
+ timeout = setTimeout(() => {
|
|
|
closeAnimation();
|
|
closeAnimation();
|
|
|
}, autoCloseDelay);
|
|
}, autoCloseDelay);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ return () => {
|
|
|
|
|
+ if(timeout) {
|
|
|
|
|
+ clearTimeout(timeout);
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
}, [
|
|
}, [
|
|
|
isMeasured
|
|
isMeasured
|
|
|
]);
|
|
]);
|