Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
adamska27 committed Apr 3, 2024
1 parent fd53517 commit a9d5965
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {isMobile as getIsMobile} from '../../util/check-is-mobile';
import style from './style.css';
import {
ActiveDotType,
ColorType,
FormatedColorsType,
FormatedDataType,
LearningProfileRadarChartPropTypes,
Expand Down Expand Up @@ -287,11 +286,11 @@ const LearningProfileRadarChart = ({

const formatedData = useMemo(() => formatData(data), [data]);

const formatedColors: FormatedColorsType[] = times(i => {
const formatedColors = times(i => {
const hasColorsProps = !!colorsProps?.length;
if (!hasColorsProps) return DEFAULT_COLORS;

const colors: ColorType | undefined = colorsProps[i];
const colors = colorsProps[i];
return colors ? Object.assign({}, DEFAULT_COLORS, colors) : DEFAULT_COLORS;
})(totalDataset);

Expand All @@ -311,7 +310,7 @@ const LearningProfileRadarChart = ({
[formatedColors]
);

const {userAgent} = navigator;
const userAgent = navigator?.userAgent;
const isMobile_ = useMemo(() => getIsMobile(userAgent), [userAgent]);

const setIsMobile_ = useCallback(() => {
Expand Down Expand Up @@ -395,6 +394,6 @@ const LearningProfileRadarChart = ({
);
};

LearningProfileRadarChart.prototype = learningProfileRadarChartPropTypes;
LearningProfileRadarChart.propTypes = learningProfileRadarChartPropTypes;

export default LearningProfileRadarChart;

0 comments on commit a9d5965

Please sign in to comment.