Skip to content

Commit

Permalink
Rebased and resigned old commit tree.
Browse files Browse the repository at this point in the history
  • Loading branch information
fvlvte committed Oct 19, 2023
1 parent 69b495a commit e651ba3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/libs/actions/Policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function deleteWorkspace(policyID, reports, policyName) {
/**
* Is the user an admin of a free policy (aka workspace)?
*
* @param {Record<string, Policy>} policies
* @param {Record<string, Policy>} [policies]
* @returns {Boolean}
*/
function isAdminOfFreePolicy(policies) {
Expand Down
12 changes: 5 additions & 7 deletions src/libs/actions/Welcome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ Onyx.connect({
callback: (value) => {
// If isFirstTimeNewExpensifyUser was true do not update it to false. We update it to false inside the Welcome.show logic
// More context here https://github.com/Expensify/App/pull/16962#discussion_r1167351359
if (!isFirstTimeNewExpensifyUser) {
isFirstTimeNewExpensifyUser = value ?? undefined;
}

isFirstTimeNewExpensifyUser = value ?? undefined;

checkOnReady();
},
});
Expand All @@ -61,9 +61,7 @@ Onyx.connect({
key: ONYXKEYS.IS_LOADING_REPORT_DATA,
initWithStoredValues: false,
callback: (value) => {
if (value) {
isLoadingReportData = value;
}
isLoadingReportData = value ?? false;
checkOnReady();
},
});
Expand Down Expand Up @@ -159,7 +157,7 @@ function show({routes, showCreateMenu = () => {}, showPopoverMenu = () => false}

// If user is not already an admin of a free policy and we are not navigating them to their workspace or creating a new workspace via workspace/new then
// we will show the create menu.
if (allPolicies && !Policy.isAdminOfFreePolicy(allPolicies) && !isDisplayingWorkspaceRoute) {
if (!Policy.isAdminOfFreePolicy(allPolicies ?? undefined) && !isDisplayingWorkspaceRoute) {
showCreateMenu();
}

Expand Down

0 comments on commit e651ba3

Please sign in to comment.