Replace environment objects with observed objects

This commit is contained in:
Arkadiusz Fal
2022-11-24 21:36:05 +01:00
parent 23fa0968c6
commit 0d333b5583
102 changed files with 427 additions and 723 deletions

View File

@@ -6,11 +6,7 @@ struct OpenVideosView: View {
@State private var playbackMode = OpenVideosModel.PlaybackMode.playNow
@State private var removeQueueItems = false
@EnvironmentObject<AccountsModel> private var accounts
@EnvironmentObject<NavigationModel> private var navigation
@EnvironmentObject<PlayerModel> private var player
@EnvironmentObject<RecentsModel> private var recents
@EnvironmentObject<SearchModel> private var search
@ObservedObject private var navigation = NavigationModel.shared
@Environment(\.openURL) private var openURL
@Environment(\.presentationMode) private var presentationMode
@@ -132,8 +128,8 @@ struct OpenVideosView: View {
openURLs(urlsToOpen)
} catch {
NavigationModel.shared.alert = Alert(title: Text("Could not open Files"))
NavigationModel.shared.presentingAlertInOpenVideos = true
navigation.alert = Alert(title: Text("Could not open Files"))
navigation.presentingAlertInOpenVideos = true
}
presentationMode.wrappedValue.dismiss()