Skip to content

Commit

Permalink
feat: sort repos by last modified (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
GianlucaP106 authored Sep 4, 2024
1 parent 1fc8ce7 commit 21e8e9b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/ui/github_repo_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"mynav/pkg/core"
"mynav/pkg/system"
"mynav/pkg/tui"
"sort"

"github.com/awesome-gocui/gocui"
"github.com/google/go-github/v62/github"
Expand Down Expand Up @@ -179,6 +180,10 @@ func (g *githubRepoView) refresh() {

repos := getApi().Github.GetUserRepos()

sort.Slice(repos, func(i, j int) bool {
return repos[i].GetUpdatedAt().After(repos[j].GetUpdatedAt().Time)
})

rows := make([][]string, 0)
rowValues := make([]*github.Repository, 0)
for _, repo := range repos {
Expand Down

0 comments on commit 21e8e9b

Please sign in to comment.