Fix network netries to work even on failures

This commit is contained in:
William Brawner 2020-05-21 09:45:21 -07:00
parent 9dec9c9df7
commit e541b5efa1

View file

@ -190,14 +190,13 @@ class PiHoleDataStore: ObservableObject {
.sink(receiveCompletion: { (completion) in
switch completion {
case .finished:
if let completionBlock = completionBlock {
completionBlock()
}
self.currentRequest = nil
return
case .failure(let error):
self.pihole = .failure(.networkError(self.oldPiHole, error: error))
}
if let completionBlock = completionBlock {
completionBlock()
}
}, receiveValue: { pihole in
UIApplication.shared.shortcutItems = [
UIApplicationShortcutItem(