Skip to content

Commit

Permalink
Merge pull request #21116 from StevenKKC/fixAccessWorkspaceError
Browse files Browse the repository at this point in the history
fix error message when access workspace created with different default contact method
  • Loading branch information
Beamanator committed Jun 21, 2023
2 parents 342d4fd + 8233486 commit 1096b6e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/libs/actions/Policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ Onyx.connect({
callback: (val) => (personalDetails = val),
});

let loginList;
Onyx.connect({
key: ONYXKEYS.LOGIN_LIST,
callback: (val) => (loginList = val),
});

/**
* Stores in Onyx the policy ID of the last workspace that was accessed by the user
* @param {String|null} policyID
Expand Down Expand Up @@ -157,7 +163,7 @@ function isAdminOfFreePolicy(policies) {
* @returns {Boolean}
*/
function isPolicyOwner(policy) {
return policy.owner === sessionEmail;
return _.keys(loginList).includes(policy.owner);
}

/**
Expand Down

0 comments on commit 1096b6e

Please sign in to comment.