From e3bf6d6239d9a0e6a57ad90f66204961930c02e5 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Thu, 12 Sep 2019 12:59:56 -0700 Subject: [PATCH] Improves error message when multiple apps fail to refresh --- AltStore/My Apps/MyAppsViewController.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/AltStore/My Apps/MyAppsViewController.swift b/AltStore/My Apps/MyAppsViewController.swift index affe6de3..fb0c16ed 100644 --- a/AltStore/My Apps/MyAppsViewController.swift +++ b/AltStore/My Apps/MyAppsViewController.swift @@ -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) }