mirror of
https://github.com/christianvidalwolf-prog/CrazeAnalytix.git
synced 2026-08-03 15:25:23 +02:00
Fix application hang by ensuring filter state initialization and adding robustness guards
This commit is contained in:
@@ -212,6 +212,7 @@ const App: React.FC = () => {
|
|||||||
sku: [],
|
sku: [],
|
||||||
title: [],
|
title: [],
|
||||||
week: [],
|
week: [],
|
||||||
|
stock: [],
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -703,7 +703,7 @@ export const mergeSalesAndAdsData = (
|
|||||||
|
|
||||||
// Helper to check stock filter
|
// Helper to check stock filter
|
||||||
const checkStockFilter = (sku: string, filters: string[], stockMap?: Map<string, number>): boolean => {
|
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;
|
if (!stockMap) return true;
|
||||||
|
|
||||||
// Normalize SKU (remove DE/EN) to match stock map
|
// Normalize SKU (remove DE/EN) to match stock map
|
||||||
|
|||||||
Reference in New Issue
Block a user