From b07109de4d0c0d50d64f78aa05bf1252375b0dfa Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Thu, 28 Nov 2024 12:01:19 +0100 Subject: [PATCH] Remove unused field gui.IsNewRepo --- pkg/gui/gui.go | 2 -- pkg/gui/recent_repos_panel.go | 10 +++------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index 4d5f625d9..1faeb85e4 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -108,8 +108,6 @@ type Gui struct { PopupHandler types.IPopupHandler - IsNewRepo bool - IsRefreshingFiles bool // we use this to decide whether we'll return to the original directory that diff --git a/pkg/gui/recent_repos_panel.go b/pkg/gui/recent_repos_panel.go index 0f2f2c704..ba6bc8ce1 100644 --- a/pkg/gui/recent_repos_panel.go +++ b/pkg/gui/recent_repos_panel.go @@ -21,8 +21,7 @@ func (gui *Gui) updateRecentRepoList() error { if err != nil { return err } - known, recentRepos := newRecentReposList(recentRepos, currentRepo) - gui.IsNewRepo = known + recentRepos = newRecentReposList(recentRepos, currentRepo) // TODO: migrate this file to use forward slashes on all OSes for consistency // (windows uses backslashes at the moment) gui.c.GetAppState().RecentRepos = recentRepos @@ -30,8 +29,7 @@ func (gui *Gui) updateRecentRepoList() error { } // newRecentReposList returns a new repo list with a new entry but only when it doesn't exist yet -func newRecentReposList(recentRepos []string, currentRepo string) (bool, []string) { - isNew := true +func newRecentReposList(recentRepos []string, currentRepo string) []string { newRepos := []string{currentRepo} for _, repo := range recentRepos { if repo != currentRepo { @@ -39,9 +37,7 @@ func newRecentReposList(recentRepos []string, currentRepo string) (bool, []strin continue } newRepos = append(newRepos, repo) - } else { - isNew = false } } - return isNew, newRepos + return newRepos }