mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Replace environment objects with observed objects
This commit is contained in:
@@ -13,8 +13,7 @@ struct AddToPlaylistView: View {
|
||||
@Environment(\.colorScheme) private var colorScheme
|
||||
@Environment(\.presentationMode) private var presentationMode
|
||||
|
||||
@EnvironmentObject<NavigationModel> private var navigation
|
||||
@EnvironmentObject<PlaylistsModel> private var model
|
||||
@ObservedObject private var model = PlaylistsModel.shared
|
||||
|
||||
var body: some View {
|
||||
Group {
|
||||
@@ -164,7 +163,7 @@ struct AddToPlaylistView: View {
|
||||
|
||||
Defaults[.lastUsedPlaylistID] = id
|
||||
|
||||
model.addVideo(playlistID: id, videoID: video.videoID, navigation: navigation)
|
||||
model.addVideo(playlistID: id, videoID: video.videoID)
|
||||
|
||||
presentationMode.wrappedValue.dismiss()
|
||||
}
|
||||
|
Reference in New Issue
Block a user