Skip to content

Commit

Permalink
fix error message when access workspace created with different defaul…
Browse files Browse the repository at this point in the history
…t contact method
  • Loading branch information
StevenKKC committed Jun 20, 2023
1 parent e6c2704 commit 8233486
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 8233486

Please sign in to comment.