fix: 修复useEffect无限执行问题 (P0安全修复)
This commit is contained in:
parent
7a4af33ff5
commit
c2950c559a
@ -47,10 +47,11 @@ export function HomePage() {
|
||||
const [formRepeatType, setFormRepeatType] = useState<RepeatType>('none');
|
||||
const [formIsHoliday, setFormIsHoliday] = useState(false);
|
||||
|
||||
// Initialize auth and data on mount
|
||||
useEffect(() => {
|
||||
checkAuth();
|
||||
fetchEvents();
|
||||
}, [checkAuth, fetchEvents]);
|
||||
fetchEvents().catch(console.error);
|
||||
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
||||
const handleLogout = async () => {
|
||||
await logout();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user