mirror of
https://github.com/yattee/yattee.git
synced 2024-12-13 05:40:32 +05:30
32 lines
844 B
Swift
32 lines
844 B
Swift
import Foundation
|
|
import SwiftUI
|
|
|
|
struct FixtureEnvironmentObjectsModifier: ViewModifier {
|
|
func body(content: Content) -> some View {
|
|
content
|
|
.environmentObject(InstancesModel())
|
|
.environmentObject(api)
|
|
.environmentObject(NavigationModel())
|
|
.environmentObject(PlaybackModel())
|
|
.environmentObject(PlaylistsModel())
|
|
.environmentObject(RecentsModel())
|
|
.environmentObject(SearchModel())
|
|
.environmentObject(SubscriptionsModel(api: api))
|
|
}
|
|
|
|
private var api: InvidiousAPI {
|
|
let api = InvidiousAPI()
|
|
|
|
api.validInstance = true
|
|
api.signedIn = true
|
|
|
|
return api
|
|
}
|
|
}
|
|
|
|
extension View {
|
|
func injectFixtureEnvironmentObjects() -> some View {
|
|
modifier(FixtureEnvironmentObjectsModifier())
|
|
}
|
|
}
|