mirror of
https://github.com/mastodon/mastodon.git
synced 2025-10-05 16:42:47 +00:00
Clean up timeout in success effect
Some checks are pending
Chromatic / Run Chromatic (push) Waiting to run
Some checks are pending
Chromatic / Run Chromatic (push) Waiting to run
This commit is contained in:
parent
95a40bef92
commit
231cbd59e6
|
@ -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(() => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user