mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
make slight change to how not modified responses are handled
This commit is contained in:
@@ -285,7 +285,7 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container,
|
||||
delegate.refreshAll(for: self, completionHandler: completion)
|
||||
}
|
||||
|
||||
public func update(_ feed: Feed, with parsedFeed: ParsedFeed, _ completion: @escaping RSVoidCompletionBlock) {
|
||||
public func update(_ feed: Feed, with parsedFeed: ParsedFeed, _ completion: @escaping (() -> Void)) {
|
||||
|
||||
feed.takeSettings(from: parsedFeed)
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ final class FeedbinAPICaller: NSObject {
|
||||
|
||||
}
|
||||
|
||||
func retrieveTags(completionHandler completion: @escaping (Result<[FeedbinTag], Error>) -> Void) {
|
||||
func retrieveTags(completionHandler completion: @escaping (Result<[FeedbinTag]?, Error>) -> Void) {
|
||||
|
||||
let callURL = feedbinBaseURL.appendingPathComponent("tags.json")
|
||||
let conditionalGet = accountMetadata?.conditionalGetInfo[AccountMetadata.ConditionalGetKeys.tags]
|
||||
|
||||
@@ -85,13 +85,15 @@ private extension FeedbinAccountDelegate {
|
||||
self?.syncFolders(account, tags)
|
||||
completion(.success(()))
|
||||
case .failure(let error):
|
||||
self?.checkErrorOrNotModified(error, completion: completion)
|
||||
completion(.failure(error))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func syncFolders(_ account: Account, _ tags: [FeedbinTag]) {
|
||||
func syncFolders(_ account: Account, _ tags: [FeedbinTag]?) {
|
||||
|
||||
guard let tags = tags else { return }
|
||||
|
||||
let tagNames = tags.map { $0.name }
|
||||
|
||||
@@ -121,18 +123,4 @@ private extension FeedbinAccountDelegate {
|
||||
|
||||
}
|
||||
|
||||
func checkErrorOrNotModified(_ error: Error, completion: @escaping (Result<Void, Error>) -> Void) {
|
||||
switch error {
|
||||
case TransportError.httpError(let status):
|
||||
if status == HTTPResponseCode.notModified {
|
||||
completion(.success(()))
|
||||
} else {
|
||||
completion(.failure(error))
|
||||
}
|
||||
default:
|
||||
completion(.failure(error))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Submodule submodules/RSWeb updated: cb3910180c...903f6dae0a
Reference in New Issue
Block a user