mirror of
https://github.com/skoelle/focusapp.git
synced 2026-09-18 12:30:26 +00:00
ui refactor
This commit is contained in:
@@ -12,6 +12,13 @@ const App: React.FC = () => {
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (error) {
|
||||
const timer = setTimeout(() => setError(null), 5000);
|
||||
return () => clearTimeout(timer);
|
||||
}
|
||||
}, [error]);
|
||||
|
||||
useEffect(() => {
|
||||
loadTasks();
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user