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 [formRepeatType, setFormRepeatType] = useState<RepeatType>('none');
|
||||||
const [formIsHoliday, setFormIsHoliday] = useState(false);
|
const [formIsHoliday, setFormIsHoliday] = useState(false);
|
||||||
|
|
||||||
|
// Initialize auth and data on mount
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
checkAuth();
|
checkAuth();
|
||||||
fetchEvents();
|
fetchEvents().catch(console.error);
|
||||||
}, [checkAuth, fetchEvents]);
|
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
const handleLogout = async () => {
|
const handleLogout = async () => {
|
||||||
await logout();
|
await logout();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user