diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 97dc3a6319d0..5f4cc20cf15f 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -2457,8 +2457,6 @@ function removeFromRoom(reportID: string, targetAccountIDs: number[]) { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, value: { - participantAccountIDs: participantAccountIDsAfterRemoval, - visibleChatMemberAccountIDs: visibleChatMemberAccountIDsAfterRemoval, pendingChatMembers, }, }, @@ -2469,8 +2467,6 @@ function removeFromRoom(reportID: string, targetAccountIDs: number[]) { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, value: { - participantAccountIDs: report?.participantAccountIDs, - visibleChatMemberAccountIDs: report?.visibleChatMemberAccountIDs, pendingChatMembers: report?.pendingChatMembers ?? null, }, }, diff --git a/src/libs/mapChildrenFlat.ts b/src/libs/mapChildrenFlat.ts index 238e57d47a83..73009a3340d4 100644 --- a/src/libs/mapChildrenFlat.ts +++ b/src/libs/mapChildrenFlat.ts @@ -14,8 +14,12 @@ import React from 'react'; * return modifiedChild; * }); */ -const mapChildrenFlat = (...args: Parameters>) => { - const mappedChildren = React.Children.map(...args); +const mapChildrenFlat = (element: C, fn: (child: C, index: number) => T) => { + if (typeof element === 'function') { + return element(false) as C; + } + + const mappedChildren = React.Children.map(element, fn); if (Array.isArray(mappedChildren) && mappedChildren.length === 1) { return mappedChildren[0];