mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-12 00:03:27 +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 }
|
||||
|
||||
let localizedText: String
|
||||
let detailText: String?
|
||||
|
||||
if let failure = failures.first, failures.count == 1
|
||||
{
|
||||
localizedText = failure.value.localizedDescription
|
||||
detailText = nil
|
||||
}
|
||||
else
|
||||
{
|
||||
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)
|
||||
toastView.tintColor = .refreshRed
|
||||
let toastView = ToastView(text: localizedText, detailText: detailText)
|
||||
toastView.show(in: self.navigationController?.view ?? self.view, duration: 2.0)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user