Skip to content

Commit

Permalink
fix: copy to clipboard notification
Browse files Browse the repository at this point in the history
  • Loading branch information
dlvhdr committed Feb 16, 2024
1 parent 1b6ddd5 commit c351548
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
23 changes: 13 additions & 10 deletions ui/modelUtils.go
Expand Up @@ -11,6 +11,7 @@ import (

tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"

"github.com/dlvhdr/gh-dash/config"
"github.com/dlvhdr/gh-dash/data"
"github.com/dlvhdr/gh-dash/ui/common"
Expand Down Expand Up @@ -190,17 +191,19 @@ func (m *Model) executeCustomCommand(cmd string) tea.Cmd {

func (m *Model) notify(text string) tea.Cmd {
id := fmt.Sprint(time.Now().Unix())
m.tasks[id] = context.Task{
Id: id,
FinishedText: text,
State: context.TaskFinished,
}
return func() tea.Msg {
startCmd := m.ctx.StartTask(
context.Task{
Id: id,
StartText: text,
FinishedText: text,
State: context.TaskStart,
})

finishCmd := func() tea.Msg {
return constants.TaskFinishedMsg{
SectionId: m.getCurrSection().GetId(),
SectionType: m.getCurrSection().GetType(),
TaskId: id,
Err: nil,
TaskId: id,
}
}

return tea.Sequence(startCmd, finishCmd)
}
2 changes: 1 addition & 1 deletion ui/ui.go
Expand Up @@ -707,7 +707,7 @@ func (m *Model) renderRunningTask() string {
return lipgloss.NewStyle().
Padding(0, 1).
Background(m.ctx.Theme.SelectedBackground).
Render(lipgloss.JoinHorizontal(lipgloss.Left, stats, currTaskStatus))
Render(lipgloss.JoinHorizontal(lipgloss.Top, stats, currTaskStatus))
}

type userFetchedMsg struct {
Expand Down

0 comments on commit c351548

Please sign in to comment.