Clean up timeout in success effect
Some checks are pending
Chromatic / Run Chromatic (push) Waiting to run

This commit is contained in:
diondiondion 2025-09-19 16:25:16 +02:00
parent 95a40bef92
commit 231cbd59e6

View File

@ -130,10 +130,15 @@ export const RefreshController: React.FC<{
useEffect(() => {
// Hide success message after a short delay
if (loadingState === 'success') {
setTimeout(() => {
const timeoutId = setTimeout(() => {
setLoadingState('idle');
}, 3000);
return () => {
clearTimeout(timeoutId);
};
}
return () => '';
}, [loadingState]);
const handleClick = useCallback(() => {