diff --git a/src/hooks/useDataService.ts b/src/hooks/useDataService.ts index 1fcb7f9..866b281 100644 --- a/src/hooks/useDataService.ts +++ b/src/hooks/useDataService.ts @@ -27,7 +27,9 @@ export function useJobs() { setJobs(dataService.getJobs()); }); - return unsubscribe; + return () => { + unsubscribe(); + }; }, []); return { @@ -62,7 +64,9 @@ export function useJob(jobId: string | null) { updateJob(); const unsubscribe = dataService.subscribe(updateJob); - return unsubscribe; + return () => { + unsubscribe(); + }; }, [jobId]); return job; diff --git a/src/pages/Index.tsx b/src/pages/Index.tsx index 9642065..80f5ed7 100644 --- a/src/pages/Index.tsx +++ b/src/pages/Index.tsx @@ -1,8 +1,9 @@ + import { useState } from 'react'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Plus, Factory, TrendingUp, Briefcase, FileText } from 'lucide-react'; -import { IndTransactionRecordNoId, IndJobRecordNoId, IndJobStatusOptions } from '@/lib/pbtypes'; +import { IndTransactionRecordNoId, IndJobRecordNoId, IndJobStatusOptions, IndTransactionRecord } from '@/lib/pbtypes'; import { formatISK } from '@/utils/priceUtils'; import JobCard from '@/components/JobCard'; import JobForm from '@/components/JobForm';