Skip to content

Commit

Permalink
early return if name hasnt changed
Browse files Browse the repository at this point in the history
  • Loading branch information
luacmartins committed Mar 11, 2024
1 parent ab0a35e commit c394083
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libs/actions/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2710,6 +2710,11 @@ function setPolicyRequiresTag(policyID: string, requiresTag: boolean) {
function renamePolicyTaglist(policyID: string, policyTagListName: {oldName: string; newName: string}, policyTags: OnyxEntry<PolicyTagList>) {
const newName = policyTagListName.newName;
const oldName = policyTagListName.oldName;

if (oldName === newName) {
return;
}

const oldPolicyTags = policyTags?.[oldName] ?? {};
const onyxData: OnyxData = {
optimisticData: [
Expand Down

0 comments on commit c394083

Please sign in to comment.