mirror of
https://github.com/christianvidalwolf-prog/CrazeAnalytix.git
synced 2026-08-03 14:45:24 +02:00
fix: resolve primary_metric toUpperCase crash on legacy experiment detail
This commit is contained in:
@@ -67,7 +67,7 @@ const ExperimentDetail: React.FC<ExperimentDetailProps> = ({ experimentId, onClo
|
||||
const chartData = useMemo(() => {
|
||||
if (!experiment || !salesData.length) return [];
|
||||
|
||||
const asinSet = new Set((experiment.asins || []).map(a => a.toUpperCase()));
|
||||
const asinSet = new Set((experiment.asins || []).map(a => (a || '').toUpperCase()));
|
||||
const weeklyMap = new Map<string, any>();
|
||||
|
||||
salesData.forEach(r => {
|
||||
@@ -253,7 +253,7 @@ const ExperimentDetail: React.FC<ExperimentDetailProps> = ({ experimentId, onClo
|
||||
<div className="bg-slate-800/30 border border-slate-700 rounded-xl p-4">
|
||||
<div className="flex justify-between items-center mb-4">
|
||||
<h3 className="text-sm font-semibold text-slate-300">
|
||||
Timeline Impact ({experiment.primary_metric.toUpperCase()})
|
||||
Timeline Impact ({(experiment.primary_metric || 'units').toUpperCase()})
|
||||
</h3>
|
||||
</div>
|
||||
<div className="h-48 w-full">
|
||||
|
||||
Reference in New Issue
Block a user