File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ package optionsui
19
19
import (
20
20
"encoding/base64"
21
21
"fmt"
22
+ "sort"
22
23
23
24
"github.com/google/chrome-ssh-agent/go/dom"
24
25
"github.com/google/chrome-ssh-agent/go/keys"
@@ -423,7 +424,23 @@ func mergeKeys(configured []*keys.ConfiguredKey, loaded []*keys.LoadedKey) []*di
423
424
})
424
425
}
425
426
426
- // TODO(ralimi) Sort displayed items to ensure consitent ordering over time
427
+ // Sort to ensure consistent ordering.
428
+ sort .Slice (result , func (i , j int ) bool {
429
+ a , b := result [i ], result [j ]
430
+ if a .Name < b .Name {
431
+ return true
432
+ }
433
+ if a .Name > b .Name {
434
+ return false
435
+ }
436
+ if a .Blob < b .Blob {
437
+ return true
438
+ }
439
+ if a .Blob > b .Blob {
440
+ return false
441
+ }
442
+ return a .ID < b .ID
443
+ })
427
444
428
445
return result
429
446
}
You can’t perform that action at this time.
0 commit comments