Skip to content

Commit

Permalink
fix bug where chart does not update project colors on data change
Browse files Browse the repository at this point in the history
  • Loading branch information
Onatcer committed Sep 17, 2024
1 parent dc33d10 commit 3d982e8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { getRandomColorWithSeed } from '@/packages/ui/src/utils/color';
import type { GroupedDataEntries } from '@/packages/api/src';
import { useReportingStore } from '@/utils/useReporting';
import { useProjectsStore } from '@/utils/useProjects';
import { storeToRefs } from 'pinia';
use([
CanvasRenderer,
Expand All @@ -32,7 +33,7 @@ const props = defineProps<{
type: string | null;
}>();
const { getNameForReportingRowEntry, emptyPlaceholder } = useReportingStore();
const { projects } = useProjectsStore();
const { projects } = storeToRefs(useProjectsStore());
const groupChartData = computed(() => {
return (
Expand All @@ -43,7 +44,7 @@ const groupChartData = computed(() => {
color = '#CCCCCC';
} else if (props.type === 'project') {
color =
projects.find((project) => project.id === entry.key)
projects.value?.find((project) => project.id === entry.key)
?.color ?? '#CCCCCC';
}
return {
Expand Down

0 comments on commit 3d982e8

Please sign in to comment.