fix(lint): avoid effect self-references in async loaders

This commit is contained in:
zetaloop
2026-04-24 09:06:55 +08:00
parent d59f7c6dc8
commit 774c62ec1c
3 changed files with 96 additions and 42 deletions
+2 -2
View File
@@ -67,7 +67,7 @@ export default function NotificationsPage() {
const [loadingError, setLoadingError] = useState<string | null>(null)
const [markingAll, setMarkingAll] = useState(false)
const loadNotifications = useCallback(async () => {
const loadNotifications = useCallback(async function loadNotifications() {
setLoading(true)
setLoadingError(null)
@@ -100,7 +100,7 @@ export default function NotificationsPage() {
}
}, [loadNotifications])
const markAllAsRead = useCallback(async () => {
const markAllAsRead = useCallback(async function markAllAsRead() {
if (markAllPendingRef.current) return
markAllPendingRef.current = true