fix bug and errors

This commit is contained in:
SlimusMinus
2026-10-06 01:00:10 +03:00
parent 73e3634ec4
commit d94a6782a4
50 changed files with 937 additions and 2642 deletions

View File

@@ -33,6 +33,10 @@ export function useFeedActions({ refresh, loadMyPosts, onAuthRequired, isAuthent
}, [refresh, loadMyPosts]);
const handleDelete = useCallback(async (postId) => {
if (!isAuthenticated) {
onAuthRequired?.();
return;
}
if (!window.confirm(t('feed.confirmDelete'))) return;
const result = await deletePost(postId);
if (result.success) {
@@ -40,9 +44,13 @@ export function useFeedActions({ refresh, loadMyPosts, onAuthRequired, isAuthent
} else {
setError(result.error);
}
}, [t, deletePost, afterMutation]);
}, [t, deletePost, afterMutation, isAuthenticated, onAuthRequired]);
const handleMarkFound = useCallback(async (postId) => {
if (!isAuthenticated) {
onAuthRequired?.();
return;
}
if (!window.confirm(t('feed.confirmMarkFound'))) return;
const result = await markAsFound(postId);
if (result.success) {
@@ -50,7 +58,7 @@ export function useFeedActions({ refresh, loadMyPosts, onAuthRequired, isAuthent
} else {
setError(result.error);
}
}, [t, markAsFound, afterMutation]);
}, [t, markAsFound, afterMutation, isAuthenticated, onAuthRequired]);
const clearError = useCallback(() => setError(""), []);