mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-03-25 08:55:46 +00:00
prevent alerts refreshing xcode with invalid session
This commit is contained in:
parent
9395b1fda2
commit
a7e36ca709
1 changed files with 6 additions and 2 deletions
|
|
@ -4,6 +4,7 @@ import Path
|
|||
import Version
|
||||
import SwiftSoup
|
||||
import struct XCModel.Xcode
|
||||
import AppleAPI
|
||||
|
||||
extension AppState {
|
||||
|
||||
|
|
@ -43,8 +44,11 @@ extension AppState {
|
|||
receiveCompletion: { [unowned self] completion in
|
||||
switch completion {
|
||||
case let .failure(error):
|
||||
self.error = error
|
||||
self.presentedAlert = .generic(title: "Unable to update selected Xcode", message: error.legibleLocalizedDescription)
|
||||
// Prevent setting the app state error if it is an invalid session, we will present the sign in view instead
|
||||
if error as? AuthenticationError != .invalidSession {
|
||||
self.error = error
|
||||
self.presentedAlert = .generic(title: "Unable to update selected Xcode", message: error.legibleLocalizedDescription)
|
||||
}
|
||||
case .finished:
|
||||
Current.defaults.setDate(Current.date(), forKey: "lastUpdated")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue