Improve group deletion and status banner UX
This commit is contained in:
@@ -180,17 +180,25 @@ func (u *ui) deleteSelectedTemplateAction() error {
|
||||
}
|
||||
|
||||
func (u *ui) createGroupAction() error {
|
||||
u.clearDeleteGroupConfirmation()
|
||||
return u.state.CreateGroup(strings.TrimSpace(u.groupName.Text()))
|
||||
}
|
||||
|
||||
func (u *ui) renameGroupAction() error {
|
||||
u.clearDeleteGroupConfirmation()
|
||||
return u.state.RenameCurrentGroup(strings.TrimSpace(u.groupName.Text()))
|
||||
}
|
||||
|
||||
func (u *ui) deleteCurrentGroupAction() error {
|
||||
if !u.deleteGroupPendingConfirmation() {
|
||||
return fmt.Errorf("confirm deleting the empty group first")
|
||||
}
|
||||
if err := u.state.DeleteCurrentGroup(); err != nil {
|
||||
return err
|
||||
}
|
||||
u.clearDeleteGroupConfirmation()
|
||||
u.currentPath = append([]string(nil), u.state.CurrentPath...)
|
||||
u.syncedPath = append([]string(nil), u.state.CurrentPath...)
|
||||
u.filter()
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user