Permalink
Browse files

component: Display most recently updated packages on top.

A recent refactor in commit 00930cb
split the list of packages into two: active and history. During that
refactor, the order in which recently displayed packages inadvertently
became inverted. This change fixes that.
  • Loading branch information...
dmitshur committed Dec 15, 2018
1 parent 15eb607 commit 5eecc4a50af573dafd9a4402ed44635fae1b41c8
Showing with 6 additions and 4 deletions.
  1. +2 −2 component/updates.go
  2. +4 −2 frontend/store/store.go
@@ -46,9 +46,9 @@ func updatesContent(active, history []*model.RepoPresentation, checkingUpdates b
vecty.Text("Recently Installed Updates"),
))

for _, rp := range history {
for i := len(history) - 1; i >= 0; i-- {
content = append(content, &RepoPresentation{
RepoPresentation: rp,
RepoPresentation: history[i],
})
}
}
@@ -10,15 +10,17 @@ import (
)

var (
active []*model.RepoPresentation
history []*model.RepoPresentation
active []*model.RepoPresentation // Latest at the end.
history []*model.RepoPresentation // Latest at the end.
checkingUpdates = true
)

// Active returns the active repo presentations in store.
// Most recently added ones are last.
func Active() []*model.RepoPresentation { return active }

// History returns the historical repo presentations in store.
// Most recently added ones are last.
func History() []*model.RepoPresentation { return history }

// CheckingUpdates reports whether the process of checking for updates is still running.

0 comments on commit 5eecc4a

Please sign in to comment.