mirror of
https://github.com/taigrr/gico.git
synced 2026-04-01 18:58:59 -07:00
starting to go down map route
This commit is contained in:
@@ -50,13 +50,14 @@ type (
|
|||||||
}
|
}
|
||||||
SettingsCursor int
|
SettingsCursor int
|
||||||
Settings struct {
|
Settings struct {
|
||||||
AllAuthors []string
|
AllAuthors map[string]bool
|
||||||
SelectedAuthors []string
|
SelectedAuthors []string
|
||||||
AllRepos []string
|
AllRepos map[string]bool
|
||||||
SelectedRepos []string
|
SelectedRepos []string
|
||||||
cursor SettingsCursor
|
cursor SettingsCursor
|
||||||
AuthorList list.Model
|
highlightedEntry int
|
||||||
RepoList list.Model
|
AuthorList list.Model
|
||||||
|
RepoList list.Model
|
||||||
}
|
}
|
||||||
Graph struct {
|
Graph struct {
|
||||||
Selected int
|
Selected int
|
||||||
@@ -290,15 +291,25 @@ func NewSettings() (Settings, error) {
|
|||||||
var m Settings
|
var m Settings
|
||||||
var err error
|
var err error
|
||||||
m.cursor = authors
|
m.cursor = authors
|
||||||
m.AllRepos, err = commits.GetMRRepos()
|
allRepos, err := commits.GetMRRepos()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return m, err
|
return m, err
|
||||||
}
|
}
|
||||||
m.SelectedRepos = m.AllRepos
|
allAuthors, err := commits.RepoSet(allRepos).GetRepoAuthors()
|
||||||
m.AllAuthors, err = commits.RepoSet(m.AllRepos).GetRepoAuthors()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return m, err
|
return m, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m.AllRepos = make(map[string]bool)
|
||||||
|
for _, v := range allRepos {
|
||||||
|
m.AllRepos[v] = true
|
||||||
|
}
|
||||||
|
|
||||||
|
m.AllAuthors = make(map[string]bool)
|
||||||
|
for _, v := range allAuthors {
|
||||||
|
m.AllAuthors[v] = false
|
||||||
|
}
|
||||||
|
m.SelectedRepos = allRepos
|
||||||
email, _ := commits.GetAuthorEmail()
|
email, _ := commits.GetAuthorEmail()
|
||||||
if email != "" {
|
if email != "" {
|
||||||
m.SelectedAuthors = append(m.SelectedAuthors, email)
|
m.SelectedAuthors = append(m.SelectedAuthors, email)
|
||||||
@@ -307,6 +318,9 @@ func NewSettings() (Settings, error) {
|
|||||||
if name != "" {
|
if name != "" {
|
||||||
m.SelectedAuthors = append(m.SelectedAuthors, name)
|
m.SelectedAuthors = append(m.SelectedAuthors, name)
|
||||||
}
|
}
|
||||||
|
for _, v := range m.SelectedRepos {
|
||||||
|
m.AllAuthors[v] = true
|
||||||
|
}
|
||||||
return m, nil
|
return m, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user