Fix 'Clear Completed' to return to previous module when queue is empty
When 'Clear Completed' empties the queue, return to the previous module instead of staying in an empty queue view. If jobs remain after clearing, stay in queue view and refresh.
This commit is contained in:
parent
ac59fad380
commit
a9ba43a03b
12
main.go
12
main.go
|
|
@ -1121,7 +1121,17 @@ func (s *appState) refreshQueueView() {
|
|||
func() { // onClear
|
||||
s.jobQueue.Clear()
|
||||
s.clearVideo()
|
||||
s.refreshQueueView() // Refresh
|
||||
|
||||
// If queue is now empty, return to previous module
|
||||
if len(s.jobQueue.List()) == 0 {
|
||||
if s.lastModule != "" && s.lastModule != "queue" {
|
||||
s.showModule(s.lastModule)
|
||||
} else {
|
||||
s.showMainMenu()
|
||||
}
|
||||
} else {
|
||||
s.refreshQueueView() // Refresh if jobs remain
|
||||
}
|
||||
},
|
||||
func() { // onClearAll
|
||||
s.jobQueue.ClearAll()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user