Remove duplicate app state group deletion
This commit is contained in:
@@ -496,28 +496,6 @@ func (s *State) NavigateToPath(path []string) {
|
|||||||
s.SelectedEntryID = ""
|
s.SelectedEntryID = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *State) DeleteCurrentGroup() error {
|
|
||||||
session, ok := s.Session.(MutableSession)
|
|
||||||
if !ok {
|
|
||||||
return fmt.Errorf("session is not mutable")
|
|
||||||
}
|
|
||||||
|
|
||||||
model, err := session.Current()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if err := model.DeleteGroup(s.CurrentPath); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
session.Replace(model)
|
|
||||||
if len(s.CurrentPath) > 0 {
|
|
||||||
s.CurrentPath = append([]string(nil), s.CurrentPath[:len(s.CurrentPath)-1]...)
|
|
||||||
}
|
|
||||||
s.Dirty = true
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *State) Save() error {
|
func (s *State) Save() error {
|
||||||
session, ok := s.Session.(SaveableSession)
|
session, ok := s.Session.(SaveableSession)
|
||||||
if !ok {
|
if !ok {
|
||||||
|
|||||||
Reference in New Issue
Block a user