summaryrefslogtreecommitdiff
path: root/internal/tui/commands.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/tui/commands.go')
-rw-r--r--internal/tui/commands.go19
1 files changed, 14 insertions, 5 deletions
diff --git a/internal/tui/commands.go b/internal/tui/commands.go
index be5c8dc..ad3255f 100644
--- a/internal/tui/commands.go
+++ b/internal/tui/commands.go
@@ -13,12 +13,13 @@ type (
selectionMsg struct{ Forward bool }
drillDownMsg struct{}
drillUpMsg struct{}
- searchActivated struct{}
modalClosed struct{}
openTimeEntryEditor struct{}
openModalUnchanged struct{}
openDeleteConfirmation struct{}
recheckBounds struct{}
+ openCreateClientModal struct{}
+ openCreateProjectModal struct{}
)
func navigate(forward bool) tea.Cmd {
@@ -52,6 +53,10 @@ func punchInOnSelection(m AppModel) tea.Cmd {
clientID, projectID, description, entryRate = m.historyBox.selection()
}
+ if clientID == "" {
+ return nil
+ }
+
_, _ = actions.New(m.queries).PunchIn(context.Background(), clientID, projectID, description, entryRate)
// TODO: use the returned TimerSession instead of re-querying everything
return m.refreshCmd()
@@ -70,10 +75,6 @@ func changeSelection(forward bool) tea.Cmd {
return func() tea.Msg { return selectionMsg{forward} }
}
-func activateSearch() tea.Cmd {
- return func() tea.Msg { return searchActivated{} }
-}
-
func closeModal() tea.Cmd {
return func() tea.Msg { return modalClosed{} }
}
@@ -89,3 +90,11 @@ func reOpenModal() tea.Cmd {
func confirmDeleteEntry() tea.Cmd {
return func() tea.Msg { return openDeleteConfirmation{} }
}
+
+func createClientModal() tea.Cmd {
+ return func() tea.Msg { return openCreateClientModal{} }
+}
+
+func createProjectModal() tea.Cmd {
+ return func() tea.Msg { return openCreateProjectModal{} }
+}