Skip to content

Commit

Permalink
fix: inbox issue store update logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekshourya29 committed Jun 3, 2024
1 parent a8184c3 commit 123e490
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions web/store/inbox/project-inbox.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,15 @@ export class ProjectInboxStore implements IProjectInboxStore {
createOrUpdateInboxIssue = (inboxIssues: TInboxIssue[], workspaceSlug: string, projectId: string) => {
if (inboxIssues && inboxIssues.length > 0) {
inboxIssues.forEach((inbox: TInboxIssue) => {
const inboxIssueDetail = this.getIssueInboxByIssueId(inbox?.issue?.id);
if (inboxIssueDetail)
update(this.inboxIssues, [inbox?.issue?.id], (existingInboxIssue) => ({
...existingInboxIssue,
const existingInboxIssueDetail = this.getIssueInboxByIssueId(inbox?.issue?.id);
if (existingInboxIssueDetail)
Object.assign(existingInboxIssueDetail, {
...inbox,
issue: {
...existingInboxIssue?.issue,
...inbox?.issue,
...existingInboxIssueDetail.issue,
...inbox.issue,
},
}));
});
else
set(this.inboxIssues, [inbox?.issue?.id], new InboxIssueStore(workspaceSlug, projectId, inbox, this.store));
});
Expand Down

0 comments on commit 123e490

Please sign in to comment.