File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -28,9 +28,16 @@ export const useBucketsStore = defineStore('buckets', {
2828 } ) ,
2929
3030 getters : {
31- hosts ( this : State ) : string [ ] {
31+ hosts ( state : State ) : string [ ] {
3232 // TODO: Include consideration of device_id UUID
33- return _ . uniq ( _ . map ( this . buckets , bucket => bucket . hostname || bucket . data . hostname ) ) ;
33+ let hosts = _ . uniq ( _ . map ( state . buckets , bucket => bucket . hostname || bucket . data . hostname ) ) ;
34+ // sort by last_updated, such that the most recently updated host is first (likely the current host)
35+ hosts = _ . orderBy (
36+ hosts ,
37+ host => _ . max ( _ . map ( this . bucketsByHostname [ host ] , b => b . last_updated ) ) ,
38+ [ 'desc' ]
39+ ) ;
40+ return hosts ;
3441 } ,
3542 // Uses device_id instead of hostname
3643 devices ( this : State ) : string [ ] {
You can’t perform that action at this time.
0 commit comments