From 4551451b5706a9ad796473ab0a544e343f7ef039 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Mon, 16 Oct 2023 18:29:59 -0500 Subject: [PATCH] Posts Notification when Source is added or removed --- AltStore/Managing Apps/AppManager.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/AltStore/Managing Apps/AppManager.swift b/AltStore/Managing Apps/AppManager.swift index 8c88e0c9..9436011c 100644 --- a/AltStore/Managing Apps/AppManager.swift +++ b/AltStore/Managing Apps/AppManager.swift @@ -24,6 +24,8 @@ extension AppManager { static let didFetchSourceNotification = Notification.Name("io.altstore.AppManager.didFetchSource") static let didUpdatePatronsNotification = Notification.Name("io.altstore.AppManager.didUpdatePatrons") + static let didAddSourceNotification = Notification.Name("io.altstore.AppManager.didAddSource") + static let didRemoveSourceNotification = Notification.Name("io.altstore.AppManager.didRemoveSource") static let expirationWarningNotificationID = "altstore-expiration-warning" static let enableJITResultNotificationID = "altstore-enable-jit" @@ -378,6 +380,8 @@ extension AppManager try await context.performAsync { try context.save() } + + NotificationCenter.default.post(name: AppManager.didAddSourceNotification, object: source) } func remove(@AsyncManaged _ source: Source, presentingViewController: UIViewController) async throws @@ -400,6 +404,8 @@ extension AppManager context.delete(source) try context.save() } + + NotificationCenter.default.post(name: AppManager.didRemoveSourceNotification, object: source) } }