Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions pkg/gui/controllers/helpers/refresh_helper.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package helpers

import (
"fmt"
"strings"
"sync"
"time"
Expand Down Expand Up @@ -831,9 +830,7 @@ func (self *RefreshHelper) refreshGithubPullRequests() {
return
}

if err := self.setGithubPullRequests(baseInfo); err != nil {
self.c.LogAction(fmt.Sprintf("Error fetching pull requests from GitHub: %s", err.Error()))
}
self.setGithubPullRequests(baseInfo)
}

type githubRemoteInfo struct {
Expand Down Expand Up @@ -914,9 +911,7 @@ func (self *RefreshHelper) promptForBaseGithubRepo(githubRemotes []githubRemoteI
self.c.Log.Error(err)
}

if err := self.setGithubPullRequests(&info); err != nil {
self.c.LogAction(fmt.Sprintf("Error fetching pull requests from GitHub: %s", err.Error()))
}
self.setGithubPullRequests(&info)
return nil
})
},
Expand Down Expand Up @@ -944,9 +939,9 @@ func (self *RefreshHelper) rebuildPullRequestsMap() {
)
}

func (self *RefreshHelper) setGithubPullRequests(baseInfo *githubRemoteInfo) error {
func (self *RefreshHelper) setGithubPullRequests(baseInfo *githubRemoteInfo) {
if len(self.c.Model().Branches) == 0 {
return nil
return
}

branches := lo.Filter(self.c.Model().Branches, func(branch *models.Branch, _ int) bool {
Expand All @@ -958,7 +953,8 @@ func (self *RefreshHelper) setGithubPullRequests(baseInfo *githubRemoteInfo) err

prs, err := self.c.Git().GitHub.FetchRecentPRs(branchNames, &baseInfo.serviceInfo, baseInfo.authToken)
if err != nil {
return err
self.c.Log.Error("error fetching pull requests from GitHub: " + err.Error())
return
}

self.c.Model().PullRequests = prs
Expand All @@ -969,8 +965,6 @@ func (self *RefreshHelper) setGithubPullRequests(baseInfo *githubRemoteInfo) err
self.c.PostRefreshUpdate(self.c.Contexts().Branches)
return nil
})

return nil
}

func (self *RefreshHelper) savePullRequestsToCache(prs []*models.GithubPullRequest) {
Expand Down
Loading