From b335bdbc2cb0842aa5a6a5f77fe596d2efbb01b4 Mon Sep 17 00:00:00 2001 From: Prateek Shourya Date: Tue, 4 Mar 2025 01:45:46 +0530 Subject: [PATCH] [RANTS-23] fix: prevent epic issues from being added to local db (#2622) --- web/core/local-db/utils/load-issues.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/core/local-db/utils/load-issues.ts b/web/core/local-db/utils/load-issues.ts index 444c07894c..6ae9b06b4d 100644 --- a/web/core/local-db/utils/load-issues.ts +++ b/web/core/local-db/utils/load-issues.ts @@ -1,5 +1,5 @@ import { TIssue } from "@plane/types"; -import { rootStore } from "@/lib/store-context"; +import { rootStore, store } from "@/lib/store-context"; import { IssueService } from "@/services/issue"; import { persistence } from "../storage.sqlite"; import { ARRAY_FIELDS, PRIORITY_MAP } from "./constants"; @@ -55,6 +55,10 @@ export const deleteIssueFromLocal = async (issue_id: any) => { export const updateIssue = async (issue: TIssue & { is_local_update: number }) => { if (document.hidden || !rootStore.user.localDBEnabled || !persistence.db) return; + // Check if the issue is an epic, and do not add it to local db + const isEpic = issue.is_epic || (issue.type_id && store.issueTypes.getIssueTypeById(issue.type_id)?.is_epic); + if (isEpic) return; + const issue_id = issue.id; // delete the issue and its meta data await deleteIssueFromLocal(issue_id);