@@ -17,7 +17,7 @@ bm.set("projects", ['project_id_1', 'project_id_2'])
1717bm.on('change', (e) => console.log('Bookmark change:', e))
1818 */
1919
20- import { sortBy , uniq } from "lodash" ;
20+ import { uniq } from "lodash" ;
2121import { useEffect , useRef , useState } from "react" ;
2222
2323import { redux } from "@cocalc/frontend/app-framework" ;
@@ -78,7 +78,7 @@ export function useBookmarkedProjects() {
7878 // Load initial data from conat
7979 const initialBookmarks = conatBookmarks . get ( PROJECTS_KEY ) ?? [ ] ;
8080 if ( Array . isArray ( initialBookmarks ) ) {
81- setBookmarkedProjects ( sortBy ( uniq ( initialBookmarks ) ) ) ;
81+ setBookmarkedProjects ( uniq ( initialBookmarks ) ) ;
8282 }
8383
8484 // Create stable listener function
@@ -90,7 +90,7 @@ export function useBookmarkedProjects() {
9090 if ( changeEvent . key === PROJECTS_KEY ) {
9191 const remoteBookmarks =
9292 ( changeEvent . value as BookmarkedProjects ) ?? [ ] ;
93- setBookmarkedProjects ( sortBy ( uniq ( remoteBookmarks ) ) ) ;
93+ setBookmarkedProjects ( uniq ( remoteBookmarks ) ) ;
9494 }
9595 } ;
9696
@@ -125,7 +125,7 @@ export function useBookmarkedProjects() {
125125 }
126126
127127 const next = bookmarked
128- ? sortBy ( uniq ( [ ...bookmarkedProjects , project_id ] ) )
128+ ? uniq ( [ project_id , ...bookmarkedProjects ] )
129129 : bookmarkedProjects . filter ( ( p ) => p !== project_id ) ;
130130
131131 // Update local state immediately for responsive UI
0 commit comments