Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: 26339 Workspace - Unable to remove error reported member #26975

Merged
merged 7 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/libs/actions/Policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -747,11 +747,16 @@ function clearDeleteMemberError(policyID, accountID) {
* @param {Number} accountID
*/
function clearAddMemberError(policyID, accountID) {
Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY_MEMBERS}${policyID}`, {
Onyx.set(`${ONYXKEYS.PERSONAL_DETAILS_LIST}`, {
...allPersonalDetails,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure why this change is here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to remove invalid user in PERSONAL_DETAILS_LIST. That why I want to use Onyx.set here to set the new personalDetails

[accountID]: null,
});
Onyx.merge(`${ONYXKEYS.PERSONAL_DETAILS_LIST}`, {
[accountID]: null,

Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY_MEMBERS}${policyID}`, {
[accountID]: {
pendingAction: null,
errors: null,
},
});
}

Expand Down
1 change: 1 addition & 0 deletions src/pages/workspace/WorkspaceMembersPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ function WorkspaceMembersPage(props) {

result.push({
keyForList: accountID,
accountID: Number(accountID),
isSelected: _.contains(selectedEmployees, Number(accountID)),
isDisabled: accountID === props.session.accountID || details.login === props.policy.owner || policyMember.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
text: props.formatPhoneNumber(details.displayName),
Expand Down
Loading