From 95319e51fff8407aaaee5e73af9a71a9f2dc0412 Mon Sep 17 00:00:00 2001 From: smanylov Date: Fri, 27 Mar 2026 15:25:30 +0700 Subject: [PATCH] remove comments --- .../ui/file-page/violation-table/file-page-violation-info.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/app/ui/file-page/violation-table/file-page-violation-info.tsx b/src/app/ui/file-page/violation-table/file-page-violation-info.tsx index 068d4e5..ad1acae 100644 --- a/src/app/ui/file-page/violation-table/file-page-violation-info.tsx +++ b/src/app/ui/file-page/violation-table/file-page-violation-info.tsx @@ -27,7 +27,6 @@ export default function FilePageViolationInfo({ selectedViolation }: { selectedV const updateStatusHandler = useCallback(async (id: number, status: MatchStatus) => { setIsUpdating(true); - // Оптимистичное обновление UI setLocalViolation(prev => prev ? { ...prev, status } : null); try { @@ -36,17 +35,14 @@ export default function FilePageViolationInfo({ selectedViolation }: { selectedV if (status === 'AUTHORIZED_USE') { toast.success('Статус обновлен'); } - // Инвалидируем кэш, чтобы данные синхронизировались с сервером queryClient.invalidateQueries({ queryKey: ['fileViolations'] }); return true; } else { - // Если ошибка - откатываем изменение setLocalViolation(selectedViolation); toast.error('Ошибка при обновлении статуса'); return false; } } catch (error) { - // При ошибке откатываем setLocalViolation(selectedViolation); toast.error('Ошибка при обновлении статуса'); return false;