diff --git a/apps/web/ee/store/timeline/grouped-timeline.store.ts b/apps/web/ee/store/timeline/grouped-timeline.store.ts index c750986093..98033f426e 100644 --- a/apps/web/ee/store/timeline/grouped-timeline.store.ts +++ b/apps/web/ee/store/timeline/grouped-timeline.store.ts @@ -1,6 +1,7 @@ import set from "lodash/set"; import { action, autorun, makeObservable, observable } from "mobx"; // Store +import { computedFn } from "mobx-utils"; import { EGanttBlockType, TGanttBlockGroup } from "@plane/types"; import { RootStore } from "@/plane-web/store/root.store"; import { BaseTimeLineStore, IBaseTimelineStore } from "@/plane-web/store/timeline/base-timeline.store"; @@ -43,14 +44,19 @@ export class GroupedTimeLineStore extends BaseTimeLineStore implements IBaseTime this.setBlockIds(flattenedBlockIds); }; - getGroupedBlockIds = (): TGanttBlockGroup[] => { + getGroupedBlockIds = computedFn((): TGanttBlockGroup[] => { const groupBlockIds: TGanttBlockGroup[] = this.blockGroups.map((group) => ({ type: group, blockIds: [], count: 0, })); - Object.entries(this.blocksMap).forEach(([blockId, block]) => { + if (!this.blockIds) return groupBlockIds; + + this.blockIds.forEach((blockId) => { + const block = this.blocksMap[blockId]; + if (!block) return; + const type = block.meta?.type as EGanttBlockType; if (type) { const group = groupBlockIds.find((group) => group.type === type); @@ -66,5 +72,5 @@ export class GroupedTimeLineStore extends BaseTimeLineStore implements IBaseTime }); return groupBlockIds; - }; + }); } diff --git a/packages/ui/src/emoji/logo.tsx b/packages/ui/src/emoji/logo.tsx index fd2727df69..76b1dc804f 100644 --- a/packages/ui/src/emoji/logo.tsx +++ b/packages/ui/src/emoji/logo.tsx @@ -29,6 +29,9 @@ export const Logo: FC = (props) => { // destructuring the logo object const { in_use, emoji, icon } = logo; + // if no in_use value, return empty fragment + if (!in_use) return <>; + // derived values const value = in_use === "emoji" ? emoji?.value : icon?.name; const color = icon?.color;