@@ -26,17 +26,19 @@ export function sortEnvironments<T extends SortType>(
2626 const difference = aIndex - bIndex ;
2727
2828 if ( difference === 0 ) {
29- // Within the same env type, order by recency: most-recent dev activity
30- // first, falling back to updatedAt when there's no recorded activity,
31- // then to username when we have no timestamps at all.
32- const aTime = ( a . lastActivity ?? a . updatedAt ) ?. getTime ( ) ;
33- const bTime = ( b . lastActivity ?? b . updatedAt ) ?. getTime ( ) ;
29+ if ( a . type === "DEVELOPMENT" && b . type === "DEVELOPMENT" ) {
30+ // Within the same env type, order by recency: most-recent dev activity
31+ // first, falling back to updatedAt when there's no recorded activity,
32+ // then to username when we have no timestamps at all.
33+ const aTime = ( a . lastActivity ?? a . updatedAt ) ?. getTime ( ) ;
34+ const bTime = ( b . lastActivity ?? b . updatedAt ) ?. getTime ( ) ;
3435
35- if ( aTime !== undefined && bTime !== undefined ) {
36- return bTime - aTime ;
36+ if ( aTime !== undefined && bTime !== undefined ) {
37+ return bTime - aTime ;
38+ }
39+ if ( aTime !== undefined ) return - 1 ;
40+ if ( bTime !== undefined ) return 1 ;
3741 }
38- if ( aTime !== undefined ) return - 1 ;
39- if ( bTime !== undefined ) return 1 ;
4042
4143 const usernameA = a . userName || "" ;
4244 const usernameB = b . userName || "" ;
0 commit comments