mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-13 08:43:27 +01:00
[AltWidget] Refactors previous widgets to use AppsTimelineProvider
This commit is contained in:
@@ -200,3 +200,28 @@ extension AppsTimelineProvider: TimelineProvider
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension AppsTimelineProvider: IntentTimelineProvider
|
||||
{
|
||||
typealias Intent = ViewAppIntent
|
||||
|
||||
func getSnapshot(for intent: Intent, in context: Context, completion: @escaping (AppsEntry) -> Void)
|
||||
{
|
||||
Task<Void, Never> {
|
||||
let bundleIDs = [intent.identifier ?? StoreApp.altstoreAppID]
|
||||
|
||||
let snapshot = await self.snapshot(for: bundleIDs)
|
||||
completion(snapshot)
|
||||
}
|
||||
}
|
||||
|
||||
func getTimeline(for intent: Intent, in context: Context, completion: @escaping (Timeline<AppsEntry>) -> Void)
|
||||
{
|
||||
Task<Void, Never> {
|
||||
let bundleIDs = [intent.identifier ?? StoreApp.altstoreAppID]
|
||||
|
||||
let timeline = await self.timeline(for: bundleIDs)
|
||||
completion(timeline)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user