mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-20 04:03:26 +01:00
Improves error message when multiple apps fail to refresh
This commit is contained in:
@@ -368,17 +368,20 @@ private extension MyAppsViewController
|
|||||||
guard !failures.isEmpty else { break }
|
guard !failures.isEmpty else { break }
|
||||||
|
|
||||||
let localizedText: String
|
let localizedText: String
|
||||||
|
let detailText: String?
|
||||||
|
|
||||||
if let failure = failures.first, failures.count == 1
|
if let failure = failures.first, failures.count == 1
|
||||||
{
|
{
|
||||||
localizedText = failure.value.localizedDescription
|
localizedText = failure.value.localizedDescription
|
||||||
|
detailText = nil
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
localizedText = String(format: NSLocalizedString("Failed to refresh %@ apps.", comment: ""), NSNumber(value: failures.count))
|
localizedText = String(format: NSLocalizedString("Failed to refresh %@ apps.", comment: ""), NSNumber(value: failures.count))
|
||||||
|
detailText = failures.first?.value.localizedDescription
|
||||||
}
|
}
|
||||||
|
|
||||||
let toastView = ToastView(text: localizedText, detailText: nil)
|
let toastView = ToastView(text: localizedText, detailText: detailText)
|
||||||
toastView.tintColor = .refreshRed
|
|
||||||
toastView.show(in: self.navigationController?.view ?? self.view, duration: 2.0)
|
toastView.show(in: self.navigationController?.view ?? self.view, duration: 2.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user