Fix application hang by ensuring filter state initialization and adding robustness guards

This commit is contained in:
Christian Vidal Wolf
2026-01-27 20:22:58 +01:00
parent ef5aeffca9
commit cb9beecaec
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -212,6 +212,7 @@ const App: React.FC = () => {
sku: [],
title: [],
week: [],
stock: [],
});
};
+1 -1
View File
@@ -703,7 +703,7 @@ export const mergeSalesAndAdsData = (
// Helper to check stock filter
const checkStockFilter = (sku: string, filters: string[], stockMap?: Map<string, number>): 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