Update split view to also handle sync manager
This commit is contained in:
@ -4,7 +4,7 @@ import SwiftUI
|
||||
|
||||
@MainActor
|
||||
public struct LibrarySplitView: View {
|
||||
@EnvironmentObject var audioController: AudioController
|
||||
@EnvironmentObject var dataService: DataService
|
||||
|
||||
@StateObject private var inboxViewModel = HomeFeedViewModel(
|
||||
folder: "inbox",
|
||||
@ -28,7 +28,7 @@ public struct LibrarySplitView: View {
|
||||
)
|
||||
)
|
||||
|
||||
@State var selected = "home"
|
||||
private let syncManager = LibrarySyncManager()
|
||||
|
||||
#if os(iOS)
|
||||
public var body: some View {
|
||||
@ -47,6 +47,11 @@ public struct LibrarySplitView: View {
|
||||
$0.preferredPrimaryColumnWidth = 230
|
||||
$0.displayModeButtonVisibility = .always
|
||||
}
|
||||
.onReceive(NSNotification.performSyncPublisher) { _ in
|
||||
Task {
|
||||
await syncManager.syncItems(dataService: dataService)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@ -92,9 +92,6 @@ struct LibraryTabView: View {
|
||||
ExpandedAudioPlayer()
|
||||
}
|
||||
.navigationBarHidden(true)
|
||||
.task {
|
||||
await syncManager.syncItems(dataService: dataService)
|
||||
}
|
||||
.onReceive(NSNotification.performSyncPublisher) { _ in
|
||||
Task {
|
||||
await syncManager.syncItems(dataService: dataService)
|
||||
|
||||
Reference in New Issue
Block a user