File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -610,7 +610,11 @@ class AppState: ObservableObject {
610610 self . installationPublishers [ id] = nil
611611 if case let . failure( error) = completion {
612612 // Prevent setting the app state error if it is an invalid session, we will present the sign in view instead
613- if error as? AuthenticationError != . invalidSession {
613+ if let error = error as? AuthenticationError , case . notAuthorized = error {
614+ self . error = error
615+ self . presentedAlert = . unauthenticated
616+
617+ } else if error as? AuthenticationError != . invalidSession {
614618 self . error = error
615619 self . presentedAlert = . generic( title: localizeString ( " Alert.Install.Error.Title " ) , message: error. legibleLocalizedDescription)
616620 }
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ enum XcodesAlert: Identifiable {
77 case privilegedHelper
88 case generic( title: String , message: String )
99 case checkMinSupportedVersion( xcode: AvailableXcode , macOS: String )
10+ case unauthenticated
1011
1112 var id : Int {
1213 switch self {
@@ -15,6 +16,7 @@ enum XcodesAlert: Identifiable {
1516 case . generic: return 3
1617 case . checkMinSupportedVersion: return 4
1718 case . cancelRuntimeInstall: return 5
19+ case . unauthenticated: return 6
1820 }
1921 }
2022}
Original file line number Diff line number Diff line change @@ -188,6 +188,20 @@ struct MainWindow: View {
188188 action: { appState. presentedAlert = nil }
189189 )
190190 )
191+ case . unauthenticated:
192+ return Alert (
193+ title: Text ( " Alert.Install.Error.Title " ) ,
194+ message: Text ( " Alert.Install.AuthError.Message " ) ,
195+ primaryButton: . default(
196+ Text ( " OK " ) ,
197+ action: {
198+ appState. presentedSheet = . signIn
199+ }
200+ ) ,
201+ secondaryButton: . cancel(
202+ Text ( " Cancel " )
203+ )
204+ )
191205 case let . checkMinSupportedVersion( xcode, deviceVersion) :
192206 return Alert (
193207 title: Text ( " Alert.MinSupported.Title " ) ,
Original file line number Diff line number Diff line change 19581958 }
19591959 }
19601960 },
1961+ "Alert.Install.AuthError.Message" : {
1962+ "localizations" : {
1963+ "en" : {
1964+ "stringUnit" : {
1965+ "state" : "translated",
1966+ "value" : "You are not authorized. Please Sign in with your Apple ID first."
1967+ }
1968+ }
1969+ }
1970+ },
19611971 "Alert.Install.Error.Need.Xcode16.1" : {
19621972 "extractionState" : "manual",
19631973 "localizations" : {
You can’t perform that action at this time.
0 commit comments