mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
Posts Notification when Source is added or removed
This commit is contained in:
@@ -24,6 +24,8 @@ extension AppManager
|
|||||||
{
|
{
|
||||||
static let didFetchSourceNotification = Notification.Name("io.altstore.AppManager.didFetchSource")
|
static let didFetchSourceNotification = Notification.Name("io.altstore.AppManager.didFetchSource")
|
||||||
static let didUpdatePatronsNotification = Notification.Name("io.altstore.AppManager.didUpdatePatrons")
|
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 expirationWarningNotificationID = "altstore-expiration-warning"
|
||||||
static let enableJITResultNotificationID = "altstore-enable-jit"
|
static let enableJITResultNotificationID = "altstore-enable-jit"
|
||||||
@@ -378,6 +380,8 @@ extension AppManager
|
|||||||
try await context.performAsync {
|
try await context.performAsync {
|
||||||
try context.save()
|
try context.save()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NotificationCenter.default.post(name: AppManager.didAddSourceNotification, object: source)
|
||||||
}
|
}
|
||||||
|
|
||||||
func remove(@AsyncManaged _ source: Source, presentingViewController: UIViewController) async throws
|
func remove(@AsyncManaged _ source: Source, presentingViewController: UIViewController) async throws
|
||||||
@@ -400,6 +404,8 @@ extension AppManager
|
|||||||
context.delete(source)
|
context.delete(source)
|
||||||
try context.save()
|
try context.save()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NotificationCenter.default.post(name: AppManager.didRemoveSourceNotification, object: source)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user