mirror of
https://github.com/twentyhq/twenty.git
synced 2024-11-27 11:03:40 +03:00
Consistent Sorting of Workspace Buttons Across Browsers (#3222)
Fixed inconsistent workspace order in different browers (#3217)
This commit is contained in:
parent
67fca68480
commit
f4405b1b38
@ -17,16 +17,16 @@ export const ObjectMetadataNavItems = () => {
|
||||
.filter((item) =>
|
||||
['person', 'company', 'opportunity'].includes(item.nameSingular),
|
||||
)
|
||||
.sort((objectMetadataItemA, _) => {
|
||||
if (objectMetadataItemA.nameSingular === 'person') {
|
||||
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,
|
||||
);
|
||||
}
|
||||
|
||||
if (objectMetadataItemA.nameSingular === 'opportunity') {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return indexA - indexB;
|
||||
}),
|
||||
...activeObjectMetadataItems
|
||||
.filter(
|
||||
|
Loading…
Reference in New Issue
Block a user