Skip to content

Commit

Permalink
Merge pull request #10870 from Expensify/alberto-deletedPolicySkip
Browse files Browse the repository at this point in the history
Skip deleted policies when deciding workspace name
  • Loading branch information
grgia authored Sep 8, 2022
2 parents f57b4f0 + d2b37a0 commit 1718572
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libs/actions/Policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ function deletePolicy(policyID) {

Growl.show(Localize.translateLocal('workspace.common.growlMessageOnDelete'), CONST.GROWL.SUCCESS, 3000);

// Removing the workspace data from Onyx as well
// Removing the workspace data from Onyx and local array as well
delete allPolicies[`${ONYXKEYS.COLLECTION.POLICY}${policyID}`];
return Onyx.set(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, null);
})
.then(() => Report.fetchAllReports(false))
Expand Down

0 comments on commit 1718572

Please sign in to comment.