Commit 8f821b0 1 parent 429258c commit 8f821b0 Copy full SHA for 8f821b0
File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -2233,15 +2233,21 @@ function searchUsers() {
2233
2233
url : `${ AppSubUrl } /api/v1/users/search?q={query}` ,
2234
2234
onResponse ( response ) {
2235
2235
const items = [ ] ;
2236
+ const searchQuery = $searchUserBox . find ( 'input' ) . val ( ) ;
2236
2237
$ . each ( response . data , ( _i , item ) => {
2237
2238
let title = item . login ;
2238
2239
if ( item . full_name && item . full_name . length > 0 ) {
2239
2240
title += ` (${ htmlEscape ( item . full_name ) } )` ;
2240
2241
}
2241
- items . push ( {
2242
+ const resultItem = {
2242
2243
title,
2243
2244
image : item . avatar_url
2244
- } ) ;
2245
+ } ;
2246
+ if ( searchQuery === item . login ) {
2247
+ items . unshift ( resultItem ) ;
2248
+ } else {
2249
+ items . push ( resultItem ) ;
2250
+ }
2245
2251
} ) ;
2246
2252
2247
2253
return { results : items } ;
You can’t perform that action at this time.
0 commit comments