Skip to content

Commit

Permalink
fix: inbox issue store update logic. (#4683)
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekshourya29 authored and sriramveeraghanta committed Jun 10, 2024
1 parent 8f35629 commit 8fe229a
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 8fe229a

Please sign in to comment.