[RANTS-23] fix: prevent epic issues from being added to local db (#2622)

This commit is contained in:
Prateek Shourya
2025-03-04 01:45:46 +05:30
committed by GitHub
parent 2e6b89039d
commit b335bdbc2c

View File

@@ -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);