@@ -350,25 +350,22 @@ func (d *OAuth) copyCode() tea.Cmd {
350 if d.State != OAuthStateDisplay {
350 if d.State != OAuthStateDisplay {
351 return nil
351 return nil
353− return tea.Sequence(
354− tea.SetClipboard(d.userCode),
355− util.ReportInfo("Code copied to clipboard"),
353+ return common.CopyToClipboard(d.userCode, "Code copied to clipboard")
359func (d *OAuth) copyCodeAndOpenURL() tea.Cmd {
356func (d *OAuth) copyCodeAndOpenURL() tea.Cmd {
360 if d.State != OAuthStateDisplay {
357 if d.State != OAuthStateDisplay {
361 return nil
358 return nil
363− return tea.Sequence(
360+ return common.CopyToClipboardWithCallback(
364− tea.SetClipboard(d.userCode),
361+ d.userCode,
362+ "Code copied and URL opened",
365 func() tea.Msg {
363 func() tea.Msg {
366 if err := browser.OpenURL(d.verificationURL); err != nil {
364 if err := browser.OpenURL(d.verificationURL); err != nil {
367 return ActionOAuthErrored{fmt.Errorf("failed to open browser: %w", err)}
365 return ActionOAuthErrored{fmt.Errorf("failed to open browser: %w", err)}
369 return nil
367 return nil
371− util.ReportInfo("Code copied and URL opened"),