Use spinner helper

This commit is contained in:
Sam Coe 2020-12-09 13:50:08 -05:00
parent b2edf782cf
commit efc05dee90
No known key found for this signature in database
GPG key ID: 8E322C20F811D086

View file

@ -8,7 +8,6 @@ import (
"time"
"github.com/MakeNowJust/heredoc"
"github.com/briandowns/spinner"
"github.com/cli/cli/api"
"github.com/cli/cli/internal/config"
"github.com/cli/cli/internal/ghrepo"
@ -93,21 +92,13 @@ func viewRun(opts *ViewOptions) error {
}
if opts.Comments {
var s *spinner.Spinner
if opts.IO.IsStdoutTTY() {
s = utils.Spinner(opts.IO.ErrOut)
utils.StartSpinner(s)
}
opts.IO.StartProgressIndicator()
comments, err := api.CommentsForIssue(apiClient, repo, issue)
opts.IO.StopProgressIndicator()
if err != nil {
return err
}
issue.Comments = *comments
if opts.IO.IsStdoutTTY() {
utils.StopSpinner(s)
}
}
opts.IO.DetectTerminalTheme()