diff --git a/Sources/LuminateHome/HomeView.swift b/Sources/LuminateHome/HomeView.swift index 14fe690..4c7eb2e 100644 --- a/Sources/LuminateHome/HomeView.swift +++ b/Sources/LuminateHome/HomeView.swift @@ -3,30 +3,14 @@ import LuminateCore public struct HomeView: View { - public var app: AdwaitaApp - public var window: AdwaitaWindow - public var client: JellyfinClient - public var userId: String + @Injected(\.client) var client + @Injected(\.userId) var userId @State private var resumeItems: [Components.Schemas.BaseItemDto] = [] @State private var nextUpItems: [Components.Schemas.BaseItemDto] = [] @State private var latestItems: [Components.Schemas.BaseItemDto] = [] @State private var libraries: [Components.Schemas.BaseItemDto] = [] @State private var isLoading = true @State private var isLoadingData = false - - @Environment("client") var apiClient: JellyfinClient? - - public init( - app: AdwaitaApp, - window: AdwaitaWindow, - client: JellyfinClient, - userId: String - ) { - self.app = app - self.window = window - self.client = client - self.userId = userId - } public var view: Body { ScrollView { @@ -46,16 +30,14 @@ public struct HomeView: View { if !resumeItems.isEmpty { MediaRow( title: "Continue Watching", - items: resumeItems, - client: client + items: resumeItems ) .padding(16, .bottom) } if !nextUpItems.isEmpty { MediaRow( title: "Next Up", - items: nextUpItems, - client: client + items: nextUpItems ) .padding(16, .bottom) } @@ -63,14 +45,12 @@ public struct HomeView: View { MediaRow( title: "Recently Added", items: latestItems, - client: client, onSeeAll: {} ) .padding(16, .bottom) } LibraryGrid( - libraries: libraries, - client: client + libraries: libraries ) } }