diff --git a/internal/ui/dialog/oauth.go b/internal/ui/dialog/oauth.go index af54b6befdeb6f3b3465986e6959c6c7618c60c6..5b7eb1cc7f768f001aa544d85570903aea4770b7 100644 --- a/internal/ui/dialog/oauth.go +++ b/internal/ui/dialog/oauth.go @@ -350,25 +350,22 @@ func (d *OAuth) copyCode() tea.Cmd { if d.State != OAuthStateDisplay { return nil } - return tea.Sequence( - tea.SetClipboard(d.userCode), - util.ReportInfo("Code copied to clipboard"), - ) + return common.CopyToClipboard(d.userCode, "Code copied to clipboard") } func (d *OAuth) copyCodeAndOpenURL() tea.Cmd { if d.State != OAuthStateDisplay { return nil } - return tea.Sequence( - tea.SetClipboard(d.userCode), + return common.CopyToClipboardWithCallback( + d.userCode, + "Code copied and URL opened", func() tea.Msg { if err := browser.OpenURL(d.verificationURL); err != nil { return ActionOAuthErrored{fmt.Errorf("failed to open browser: %w", err)} } return nil }, - util.ReportInfo("Code copied and URL opened"), ) }