Skip to content

Commit

Permalink
Fixed inconsistent workspace order in different browers (#3217)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeong-Min-Cho committed Jan 3, 2024
1 parent 67fca68 commit 751dfe7
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ export const ObjectMetadataNavItems = () => {
.filter((item) =>
['person', 'company', 'opportunity'].includes(item.nameSingular),
)
.sort((objectMetadataItemA, _) => {
if (objectMetadataItemA.nameSingular === 'person') {
return -1;
}

if (objectMetadataItemA.nameSingular === 'opportunity') {
return 1;
.sort((objectMetadataItemA, objectMetadataItemB) => {
const order = ['person', 'company', 'opportunity'];
const indexA = order.indexOf(objectMetadataItemA.nameSingular);
const indexB = order.indexOf(objectMetadataItemB.nameSingular);
if (indexA === -1 || indexB === -1) {
return objectMetadataItemA.nameSingular.localeCompare(
objectMetadataItemB.nameSingular,
);
}

return 0;
return indexA - indexB;
}),
...activeObjectMetadataItems
.filter(
Expand Down

0 comments on commit 751dfe7

Please sign in to comment.