Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

refactor(profile-ui): make home sort comparator symmetric r1-l3

Josuéf66f4ecabe0b
diff --git a/profile-ui/app/components/Sidebar/index.tsx b/profile-ui/app/components/Sidebar/index.tsx
index 273be993c..108f9bde9 100644
--- a/profile-ui/app/components/Sidebar/index.tsx
+++ b/profile-ui/app/components/Sidebar/index.tsx
@@ -19,11 +19,11 @@ export function Sidebar({ currentRoute, isOpen = false, onNavigate, onLogout }:
Object.entries(PROFILE_SIDEBAR_ITEMS) as Array<[ProfileRouteKey, ProfileSidebarItem]>
)
.filter(([routeKey]) => routeKey !== 'settings')
- .sort(([firstRouteKey, first], [secondRouteKey, second]) => {
- if (firstRouteKey === 'home') return -1
- if (secondRouteKey === 'home') return 1
- return first.label.localeCompare(second.label)
- })
+ .sort(
+ ([firstRouteKey, first], [secondRouteKey, second]) =>
+ Number(secondRouteKey === 'home') - Number(firstRouteKey === 'home') ||
+ first.label.localeCompare(second.label)
+ )
const settings = PROFILE_SIDEBAR_ITEMS.settings
return (
diff --git a/profile-ui/package-lock.json b/profile-ui/package-lock.json
index 11c07fe18..eb7a0b123 100644
--- a/profile-ui/package-lock.json
+++ b/profile-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-profile-ui",
- "version": "0.1.148",
+ "version": "0.1.149",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-profile-ui",
- "version": "0.1.148",
+ "version": "0.1.149",
"dependencies": {
"@clerum/desktop-app-links": "file:../packages/desktop-app-links",
"@clerum/frontend-components": "file:../packages/frontend-components",
diff --git a/profile-ui/package.json b/profile-ui/package.json
index 01ce2fd98..b7e9f6e3b 100644
--- a/profile-ui/package.json
+++ b/profile-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-profile-ui",
- "version": "0.1.148",
+ "version": "0.1.149",
"private": true,
"scripts": {
"dev": "next dev",