Skip to content

Commit

Permalink
Merge pull request #36178 from ZhenjaHorbach/workspaces-listed-in-roo…
Browse files Browse the repository at this point in the history
…m-are-not-listed-in-alphabetical-order
  • Loading branch information
francoisl authored Feb 12, 2024
2 parents 4ceb7ee + 78bbc35 commit 6ce5574
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/libs/PolicyUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ type UnitRate = {rate: number};
* These are policies that we can use to create reports with in NewDot.
*/
function getActivePolicies(policies: OnyxCollection<Policy>): Policy[] | undefined {
return Object.values(policies ?? {}).filter<Policy>((policy): policy is Policy => policy !== null && policy && policy.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE);
return Object.values(policies ?? {}).filter<Policy>(
(policy): policy is Policy => policy !== null && policy && policy.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE && !!policy.name && !!policy.id,
);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/WorkspaceNewRoomPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function WorkspaceNewRoomPage(props) {
key: policy.id,
value: policy.id,
}),
),
).sort((a, b) => a.label.toLowerCase().localeCompare(b.label.toLowerCase())),
[props.policies],
);
const [policyID, setPolicyID] = useState(() => {
Expand Down

0 comments on commit 6ce5574

Please sign in to comment.