Skip to content

Commit

Permalink
Merge pull request #2337 from CruGlobal/GT-2436-add-network-connectio…
Browse files Browse the repository at this point in the history
…n-lost-phrase

GT-2436 add network connection lost phrase
  • Loading branch information
levieggertcru authored Nov 8, 2024
2 parents c014c6d + 03a81e7 commit ad53d63
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 6 additions & 9 deletions godtools/App/Flows/Flow+PresentError/Flow+PresentError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ extension Flow {

let localizationServices: LocalizationServices = appDiContainer.dataLayer.getLocalizationServices()

let defaultErrorTitle: String = localizationServices.stringForLocaleElseEnglish(
localeIdentifier: appLanguage,
key: LocalizableStringKeys.error.key
)

let defaultErrorMessage: String = error.localizedDescription

let title: String
let message: String

Expand Down Expand Up @@ -57,8 +50,12 @@ extension Flow {
}
else {

title = defaultErrorTitle
message = defaultErrorMessage
title = localizationServices.stringForLocaleElseEnglish(
localeIdentifier: appLanguage,
key: LocalizableStringKeys.error.key
)

message = error.localizedDescription + "\n error code: \(error.code)"
}

presentAlert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extension Error {
}

var isNetworkConnectionLost: Bool {
return code == Int(CFNetworkErrors.cfErrorHTTPConnectionLost.rawValue)
return code == Int(CFNetworkErrors.cfErrorHTTPConnectionLost.rawValue) || code == Int(CFNetworkErrors.cfurlErrorNetworkConnectionLost.rawValue)
}

var isUserCancelled: Bool {
Expand Down

0 comments on commit ad53d63

Please sign in to comment.