From cb9beecaec191d73b3dd3fbbb5b3ab5dd5c4cd4c Mon Sep 17 00:00:00 2001 From: Christian Vidal Wolf Date: Tue, 27 Jan 2026 20:22:58 +0100 Subject: [PATCH] Fix application hang by ensuring filter state initialization and adding robustness guards --- App.tsx | 1 + services/dataProcessor.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/App.tsx b/App.tsx index bdd4991..4d444f6 100644 --- a/App.tsx +++ b/App.tsx @@ -212,6 +212,7 @@ const App: React.FC = () => { sku: [], title: [], week: [], + stock: [], }); }; diff --git a/services/dataProcessor.ts b/services/dataProcessor.ts index f0c48cc..19a4c57 100644 --- a/services/dataProcessor.ts +++ b/services/dataProcessor.ts @@ -703,7 +703,7 @@ export const mergeSalesAndAdsData = ( // Helper to check stock filter const checkStockFilter = (sku: string, filters: string[], stockMap?: Map): boolean => { - if (!filters || filters.length === 0) return true; + if (!filters || !Array.isArray(filters) || filters.length === 0) return true; if (!stockMap) return true; // Normalize SKU (remove DE/EN) to match stock map