Skip to content

Commit

Permalink
Merge pull request #39231 from bernhardoj/fix/38821-missing-strikethr…
Browse files Browse the repository at this point in the history
…ough-on-pending-delete-room-members
  • Loading branch information
francoisl authored Apr 1, 2024
2 parents 99cc0b6 + 3ca25ee commit b3987f0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 18 deletions.
22 changes: 11 additions & 11 deletions src/components/OptionRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,14 @@ function OptionRow({
}

return (
<OfflineWithFeedback
pendingAction={option.pendingAction}
errors={option.allReportErrors}
shouldShowErrorMessages={false}
needsOffscreenAlphaCompositing
>
<Hoverable>
{(hovered) => (
<Hoverable>
{(hovered) => (
<OfflineWithFeedback
pendingAction={option.pendingAction}
errors={option.allReportErrors}
shouldShowErrorMessages={false}
needsOffscreenAlphaCompositing
>
<PressableWithFeedback
nativeID={keyForList}
ref={pressableRef}
Expand Down Expand Up @@ -314,9 +314,9 @@ function OptionRow({
</View>
)}
</PressableWithFeedback>
)}
</Hoverable>
</OfflineWithFeedback>
</OfflineWithFeedback>
)}
</Hoverable>
);
}

Expand Down
5 changes: 0 additions & 5 deletions src/libs/actions/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -780,15 +780,12 @@ function removeOptimisticAnnounceRoomMembers(policyID: string, accountIDs: numbe
}

if (announceReport?.participantAccountIDs) {
const remainUsers = announceReport.participantAccountIDs.filter((e) => !accountIDs.includes(e));
const pendingChatMembers = ReportUtils.getPendingChatMembers(accountIDs, announceReport?.pendingChatMembers ?? [], CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE);

announceRoomMembers.onyxOptimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${announceReport.reportID}`,
value: {
participantAccountIDs: [...remainUsers],
visibleChatMemberAccountIDs: [...remainUsers],
pendingChatMembers,
},
});
Expand All @@ -797,8 +794,6 @@ function removeOptimisticAnnounceRoomMembers(policyID: string, accountIDs: numbe
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${announceReport.reportID}`,
value: {
participantAccountIDs: announceReport.participantAccountIDs,
visibleChatMemberAccountIDs: announceReport.visibleChatMemberAccountIDs,
pendingChatMembers: announceReport?.pendingChatMembers ?? null,
},
});
Expand Down
2 changes: 1 addition & 1 deletion src/pages/ReportParticipantsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const getAllParticipants = (
!!userPersonalDetail?.login && !CONST.RESTRICTED_ACCOUNT_IDS.includes(accountID) ? LocalePhoneNumber.formatPhoneNumber(userPersonalDetail.login) : translate('common.hidden');
const displayName = PersonalDetailsUtils.getDisplayNameOrDefault(userPersonalDetail);

const pendingChatMember = report?.pendingChatMembers?.find((member) => member.accountID === accountID.toString());
const pendingChatMember = report?.pendingChatMembers?.findLast((member) => member.accountID === accountID.toString());
return {
alternateText: userLogin,
pendingAction: pendingChatMember?.pendingAction,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/RoomMembersPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ function RoomMembersPage({report, session, policies}: RoomMembersPageProps) {
return;
}
}
const pendingChatMember = report?.pendingChatMembers?.find((member) => member.accountID === accountID.toString());
const pendingChatMember = report?.pendingChatMembers?.findLast((member) => member.accountID === accountID.toString());

result.push({
keyForList: String(accountID),
Expand Down

0 comments on commit b3987f0

Please sign in to comment.