Skip to content

Commit

Permalink
Merge pull request #51923 from bernhardoj/fix/51316-ws-chat-for-inval…
Browse files Browse the repository at this point in the history
…id-member-not-removed

Fix WS chat for invalid member doesn't show error
  • Loading branch information
marcochavezf authored Nov 6, 2024
2 parents 7a90267 + fddb6b7 commit 1679540
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/libs/actions/Policy/Member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@ function buildAnnounceRoomMembersOnyxData(policyID: string, accountIDs: number[]
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${announceReport?.reportID}`,
value: {
participants: announceReport?.participants ?? null,
participants: accountIDs.reduce((acc, curr) => {
Object.assign(acc, {[curr]: null});
return acc;
}, {}),
pendingChatMembers: announceReport?.pendingChatMembers ?? null,
},
});
Expand Down
10 changes: 10 additions & 0 deletions src/libs/actions/Policy/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,16 @@ function createPolicyExpenseChats(policyID: string, invitedEmailsToAccountIDs: I
isLoadingInitialReportActions: false,
},
});

workspaceMembersChats.onyxFailureData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${optimisticReport.reportID}`,
value: {
errorFields: {
createChat: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('report.genericCreateReportFailureMessage'),
},
},
});
});
return workspaceMembersChats;
}
Expand Down

0 comments on commit 1679540

Please sign in to comment.