diff --git a/src/cmd/tui/tui_groups.go b/src/cmd/tui/tui_groups.go index 4e3de40..61ece6b 100644 --- a/src/cmd/tui/tui_groups.go +++ b/src/cmd/tui/tui_groups.go @@ -1,7 +1,6 @@ package tui import ( - "log" "slices" "strings" @@ -76,11 +75,13 @@ func (m mainModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { delete(selected, string(sel)) } users := utils.Groups[group] + //TODO: this may be able to be done in a more efficient way currently this would scale poorly for k, v := range dupProtect { if _, ok := selected[k]; !ok { for _, user := range users { - if strings.Contains(user.Names, v) { - selected[k] = item(k) + split := strings.Split(user.Names, "/") + if split[0] == v || split[1] == v { + selectToggle(item(k)) } } } @@ -144,18 +145,3 @@ func (m *mainModel) Next() { m.index++ } } - -func Entry_GR() string { - p := tea.NewProgram(newModel()) - - m, err := p.Run() - if err != nil { - log.Fatal(err) - } - - if m.(mainModel).currentFocusedModel() != "" { - // returns the group name - return strings.Split(m.(mainModel).currentFocusedModel(), ":")[0] - } - return "" -}