mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-16 10:13:27 +01:00
Posts Notification when Source is added or removed
This commit is contained in:
@@ -22,6 +22,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"
|
||||||
@@ -366,6 +368,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
|
||||||
@@ -388,6 +392,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