Skip to content

Commit

Permalink
Fixing assumption that groupBy is always an array
Browse files Browse the repository at this point in the history
  • Loading branch information
simianhacker committed Apr 19, 2023
1 parent b7bcf32 commit c0fe697
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ const LogsRatioChart: React.FC<ChartProps> = ({
const barSeries = useMemo(() => {
return series.flatMap(({ points, id }) => points.map((point) => ({ ...point, groupBy: id })));
}, [series]);

if (isLoading) {
return <LoadingState />;
} else if (hasError) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const useChartPreviewData = ({
let seriesQueryB = ratio[1].data.series[0].points;
let seriesId = 'ratio';
// When groupBy and a filter is applied, return the ratio only for the filtered grouped-by
if (ruleParams.groupBy.length && filterSeriesByGroupName) {
if (ruleParams.groupBy?.length && filterSeriesByGroupName) {
seriesId = filterSeriesByGroupName;
seriesQueryA =
ratio[0].data.series.find((series) => series.id === filterSeriesByGroupName)
Expand Down

0 comments on commit c0fe697

Please sign in to comment.