fix
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
aovantsev
2025-10-03 14:50:18 +03:00
parent 69a9b7b689
commit 5cde4bf00a
3 changed files with 12 additions and 13 deletions

View File

@@ -24,8 +24,8 @@ WORKDIR /app/frontend
# Copy package files
COPY frontend/package*.json ./
# Install dependencies
RUN npm ci --only=production
# Install dependencies (including dev dependencies for build)
RUN npm ci
# Copy source code
COPY frontend/ ./

View File

@@ -1,10 +1,10 @@
import React, { useState, useEffect } from 'react';
import React, { useState, useEffect, useCallback } from 'react';
import { useParams, useNavigate } from 'react-router-dom';
import { useCounters } from '../hooks/useCounters';
import { useAuth } from '../hooks/useAuth';
import { CounterWithStats, CounterEntry } from '../types';
import { countersAPI } from '../services/api';
import { ArrowLeft, Plus, Minus, Edit, Trash2, Calendar, TrendingUp } from 'lucide-react';
import { ArrowLeft, Plus, Minus, Trash2, Calendar } from 'lucide-react';
import { format } from 'date-fns';
export const CounterDetail: React.FC = () => {
@@ -19,13 +19,7 @@ export const CounterDetail: React.FC = () => {
const [isIncrementing, setIsIncrementing] = useState(false);
const [error, setError] = useState<string | null>(null);
useEffect(() => {
if (id) {
loadCounterData();
}
}, [id]);
const loadCounterData = async () => {
const loadCounterData = useCallback(async () => {
if (!id) return;
setIsLoading(true);
@@ -95,7 +89,13 @@ export const CounterDetail: React.FC = () => {
} finally {
setIsLoading(false);
}
};
}, [id, isAuthenticated]);
useEffect(() => {
if (id) {
loadCounterData();
}
}, [id, loadCounterData]);
const handleIncrement = async (value: number) => {
if (!counter) return;

View File

@@ -1,5 +1,4 @@
import React, { useState } from 'react';
import { Link } from 'react-router-dom';
import { useCounters } from '../hooks/useCounters';
import { useAuth } from '../hooks/useAuth';
import { CreateCounterModal } from './CreateCounterModal';