mirror of
https://github.com/jellyfin/Swiftfin.git
synced 2024-12-04 12:23:26 +00:00
Merge pull request #26 from PangMo5/PangMo5/apply-StateObject
Change some ObservedObject to StateObject
This commit is contained in:
commit
4f8d56b588
@ -13,7 +13,7 @@ struct LibraryListView: View {
|
||||
private var viewContext
|
||||
@EnvironmentObject
|
||||
var globalData: GlobalData
|
||||
@ObservedObject
|
||||
@StateObject
|
||||
var viewModel: LibraryListViewModel
|
||||
|
||||
var body: some View {
|
||||
|
@ -15,7 +15,7 @@ struct LibrarySearchView: View {
|
||||
private var viewContext
|
||||
@EnvironmentObject
|
||||
var globalData: GlobalData
|
||||
@ObservedObject
|
||||
@StateObject
|
||||
var viewModel: LibrarySearchViewModel
|
||||
|
||||
@State
|
||||
|
@ -13,7 +13,7 @@ struct LibraryView: View {
|
||||
private var viewContext
|
||||
@EnvironmentObject
|
||||
var globalData: GlobalData
|
||||
@ObservedObject
|
||||
@StateObject
|
||||
var viewModel: LibraryViewModel
|
||||
|
||||
@State
|
||||
@ -27,7 +27,7 @@ struct LibraryView: View {
|
||||
private var tracks: [GridItem] = []
|
||||
|
||||
init(viewModel: LibraryViewModel, title: String) {
|
||||
self.viewModel = viewModel
|
||||
_viewModel = StateObject(wrappedValue: viewModel)
|
||||
self.title = title
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user