Skip to content

Commit

Permalink
move loader closer to fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
jzyinq committed Mar 25, 2024
1 parent 5d14089 commit b520a52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions gojira/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ func NewWorkLogIssues() error {
return nil
}
if app.workLogsIssues.startDate != startDate || app.workLogsIssues.endDate != endDate {
app.ui.loaderView.Show("Fetching worklogs...")
app.workLogs, err = GetWorkLogs()
app.ui.loaderView.Hide()
if err != nil {
return err
}
Expand Down
2 changes: 0 additions & 2 deletions gojira/dayview.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,11 @@ func loadWorklogs() {
case loadingWorklogs <- true:
go func() {
defer func() { <-loadingWorklogs }()
app.ui.loaderView.Show("Fetching worklogs...")
err := NewWorkLogIssues()
if err != nil {
app.ui.errorView.ShowError(err.Error())
}
app.ui.dayView.update()
app.ui.loaderView.Hide()
}()
default:
// The goroutine is already loadingWorklogs, do nothing
Expand Down

0 comments on commit b520a52

Please sign in to comment.