mirror of
https://github.com/makeplane/plane.git
synced 2025-12-25 16:19:43 +01:00
[WEB-2896] fix: mutation problem with issue properties while accepting an intake issue. (#6277)
This commit is contained in:
@@ -64,9 +64,10 @@ export const updatePersistentLayer = async (issueIds: string | string[]) => {
|
||||
issueIds.forEach(async (issueId) => {
|
||||
const dbIssue = await persistence.getIssue(issueId);
|
||||
const issue = rootStore.issue.issues.getIssueById(issueId);
|
||||
const updatedIssue = dbIssue ? { ...dbIssue, ...issue } : issue;
|
||||
|
||||
if (issue) {
|
||||
addIssueToPersistanceLayer(issue);
|
||||
if (updatedIssue) {
|
||||
addIssueToPersistanceLayer(updatedIssue);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -98,7 +98,9 @@ export class InboxIssueStore implements IInboxIssueStore {
|
||||
|
||||
// If issue accepted sync issue to local db
|
||||
if (status === EInboxIssueStatus.ACCEPTED) {
|
||||
addIssueToPersistanceLayer({ ...this.issue, ...inboxIssue.issue });
|
||||
const updatedIssue = { ...this.issue, ...inboxIssue.issue };
|
||||
this.store.issue.issues.addIssue([updatedIssue]);
|
||||
await addIssueToPersistanceLayer(updatedIssue);
|
||||
}
|
||||
} catch {
|
||||
runInAction(() => set(this, "status", previousData.status));
|
||||
|
||||
Reference in New Issue
Block a user