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;