[FIX] Issues introduced by changes to the AltSource specification.

This commit is contained in:
Fabian Thies
2023-01-13 13:37:38 +01:00
parent b9b309e603
commit b5dea18073
3 changed files with 19 additions and 13 deletions

View File

@@ -68,7 +68,9 @@ class NotificationManager: ObservableObject {
func showNotification(title: String, detailText: String?) { func showNotification(title: String, detailText: String?) {
let notificationId = UUID() let notificationId = UUID()
DispatchQueue.main.async {
self.notifications[notificationId] = Notification(id: notificationId, title: title, message: detailText) self.notifications[notificationId] = Notification(id: notificationId, title: title, message: detailText)
}
let dismissWorkItem = DispatchWorkItem { let dismissWorkItem = DispatchWorkItem {
self.notifications.removeValue(forKey: notificationId) self.notifications.removeValue(forKey: notificationId)

View File

@@ -162,20 +162,24 @@ struct AppDetailView: View {
.bold() .bold()
.font(.title3) .font(.title3)
Text("\(L10n.AppDetailView.version) \(storeApp.version)") if let version = storeApp.latestVersion?.version {
Text("\(L10n.AppDetailView.version) \(version)")
.font(.callout) .font(.callout)
.foregroundColor(.secondary) .foregroundColor(.secondary)
} }
}
Spacer() Spacer()
if let versionDate = storeApp.versionDate, let versionSize = storeApp.size {
VStack(alignment: .trailing) { VStack(alignment: .trailing) {
Text(dateFormatter.string(from: storeApp.versionDate)) Text(dateFormatter.string(from: versionDate))
Text(byteCountFormatter.string(fromByteCount: Int64(storeApp.size))) Text(byteCountFormatter.string(fromByteCount: Int64(versionSize)))
} }
.font(.callout) .font(.callout)
.foregroundColor(.secondary) .foregroundColor(.secondary)
} }
}
if let versionDescription = storeApp.versionDescription { if let versionDescription = storeApp.versionDescription {
ExpandableText(text: versionDescription) ExpandableText(text: versionDescription)

View File

@@ -15,10 +15,10 @@ struct MyAppsView: View {
// TODO: Refactor // TODO: Refactor
@SwiftUI.FetchRequest(sortDescriptors: [ @SwiftUI.FetchRequest(sortDescriptors: [
NSSortDescriptor(keyPath: \InstalledApp.storeApp?.versionDate, ascending: true), NSSortDescriptor(keyPath: \InstalledApp.storeApp?.latestVersion?.date, ascending: true),
NSSortDescriptor(keyPath: \InstalledApp.name, ascending: true) NSSortDescriptor(keyPath: \InstalledApp.name, ascending: true)
], predicate: NSPredicate(format: "%K == YES AND %K != nil AND %K != %K", ], predicate: NSPredicate(format: "%K == YES AND %K != nil AND %K != %K",
#keyPath(InstalledApp.isActive), #keyPath(InstalledApp.storeApp), #keyPath(InstalledApp.version), #keyPath(InstalledApp.storeApp.version))) #keyPath(InstalledApp.isActive), #keyPath(InstalledApp.storeApp), #keyPath(InstalledApp.version), #keyPath(InstalledApp.storeApp.latestVersion.version)))
var updates: FetchedResults<InstalledApp> var updates: FetchedResults<InstalledApp>