Debrid: Fix cleanup of unrestrict and task

The task can be set to nil after completion, and the unrestrict
flag should also be set to nil when the batch sheet is dismissed.

Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
kingbri 2024-06-13 09:44:13 -04:00 committed by Brian Dashore
parent e14c684b5f
commit aa0712b967
2 changed files with 2 additions and 0 deletions

View file

@ -375,6 +375,7 @@ class DebridManager: ObservableObject {
defer {
logManager?.hideIndeterminateToast()
requiresUnrestrict = false
currentDebridTask = nil
}
logManager?.updateIndeterminateToast("Loading content", cancelAction: {

View file

@ -50,6 +50,7 @@ struct BatchChoiceView: View {
try? await Task.sleep(seconds: 1)
debridManager.clearSelectedDebridItems()
debridManager.requiresUnrestrict = false
}
}
}