Skip to content

Commit

Permalink
[Misc] Only logout if the error when loading overview is HTTP 403.
Browse files Browse the repository at this point in the history
  • Loading branch information
honganhkhoa committed Feb 27, 2024
1 parent 2abae7a commit ed7423f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Surround.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1407,7 +1407,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2024021901;
CURRENT_PROJECT_VERSION = 2024022701;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -1474,7 +1474,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 2024021901;
CURRENT_PROJECT_VERSION = 2024022701;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down
9 changes: 5 additions & 4 deletions Surround/Services/OGSService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -800,13 +800,14 @@ class OGSService: ObservableObject {
}
}
}.receive(on: RunLoop.main).sink(receiveCompletion: { result in
self.isLoadingOverview = false
self.overviewLoadingCancellable = nil
if case .failure(let error) = result {
print(error)
self.logout()
return
if let error = error as? AFError, case .responseValidationFailed(.unacceptableStatusCode(403)) = error {
self.logout()
}
}
self.isLoadingOverview = false
self.overviewLoadingCancellable = nil
if let finishCallback = finishCallback {
finishCallback()
}
Expand Down

0 comments on commit ed7423f

Please sign in to comment.