fix: inbox issue store update logic. (#4683)
This commit is contained in:
parent
a428bc16c4
commit
ddfd953408
1 changed files with 6 additions and 7 deletions
|
|
@ -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));
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue