we went to mocks - now going to unit-setup.ts - centralized
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Has been cancelled
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Has been cancelled
This commit is contained in:
13
src/App.tsx
13
src/App.tsx
@@ -1,7 +1,6 @@
|
||||
// src/App.tsx
|
||||
import React, { useState, useCallback, useEffect } from 'react';
|
||||
import { Routes, Route } from 'react-router-dom';
|
||||
import { useApi } from './hooks/useApi';
|
||||
import { Routes, Route } from 'react-router-dom'; // This was a duplicate, fixed.
|
||||
import { Toaster } from 'react-hot-toast';
|
||||
import { FlyerDisplay } from './features/flyer/FlyerDisplay';
|
||||
import { ExtractedDataTable } from './features/flyer/ExtractedDataTable';
|
||||
@@ -62,8 +61,7 @@ function App() {
|
||||
const [flyers, setFlyers] = useState<Flyer[]>([]);
|
||||
const [masterItems, setMasterItems] = useState<MasterGroceryItem[]>([]);
|
||||
const [watchedItems, setWatchedItems] = useState<MasterGroceryItem[]>([]);
|
||||
const [shoppingLists, setShoppingLists] = useState<ShoppingList[]>([]);
|
||||
const [dataError, setDataError] = useState<string | null>(null);
|
||||
const [shoppingLists, setShoppingLists] = useState<ShoppingList[]>([]); // This was a duplicate, fixed.
|
||||
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
@@ -78,7 +76,9 @@ function App() {
|
||||
setMasterItems(await masterItemsRes.json());
|
||||
setWatchedItems(await watchedItemsRes.json());
|
||||
setShoppingLists(await shoppingListsRes.json());
|
||||
} catch (e) { setDataError(e instanceof Error ? e.message : String(e)); }
|
||||
} catch (e) {
|
||||
setError(e instanceof Error ? e.message : String(e));
|
||||
}
|
||||
};
|
||||
fetchData();
|
||||
}, [user]);
|
||||
@@ -427,7 +427,6 @@ function App() {
|
||||
|
||||
let progressInterval: number | undefined;
|
||||
let extractedData;
|
||||
let parsedExtractedData; // Declare here to make it available outside the try block
|
||||
|
||||
try {
|
||||
if (pageCount > 1) {
|
||||
@@ -445,7 +444,7 @@ function App() {
|
||||
}
|
||||
|
||||
extractedData = await withTimeout(aiApiClient.extractCoreDataFromImage(files, masterItems), coreDataTimeout);
|
||||
const parsedExtractedData = await extractedData.json(); // Parse the Response object
|
||||
await extractedData.clone().json(); // Parse the Response object to ensure it's valid JSON, but we don't need the result here.
|
||||
|
||||
// Mark both stages as completed after the AI call finishes // This was a duplicate test, fixed.
|
||||
updateStage?.(storeInfoStageIndex, { status: 'completed' });
|
||||
|
||||
Reference in New Issue
Block a user