Locations manifest, reorganized instances settings

This commit is contained in:
Arkadiusz Fal
2022-07-01 23:28:32 +02:00
parent 0f46bb179a
commit 7a9a490558
28 changed files with 686 additions and 214 deletions

View File

@@ -19,6 +19,7 @@ struct ContentView: View {
@EnvironmentObject<PlaylistsModel> private var playlists
@EnvironmentObject<RecentsModel> private var recents
@EnvironmentObject<SearchModel> private var search
@EnvironmentObject<SettingsModel> private var settings
@EnvironmentObject<SubscriptionsModel> private var subscriptions
@EnvironmentObject<ThumbnailsModel> private var thumbnailsModel
@@ -42,6 +43,7 @@ struct ContentView: View {
AppSidebarNavigation()
#elseif os(tvOS)
TVNavigationView()
.environmentObject(settings)
#endif
}
.onChange(of: accounts.signedIn) { _ in
@@ -105,10 +107,12 @@ struct ContentView: View {
}
)
.background(
EmptyView().sheet(isPresented: $navigation.presentingSettings, onDismiss: openWelcomeScreenIfAccountEmpty) {
EmptyView().sheet(isPresented: $navigation.presentingSettings) {
SettingsView()
.environmentObject(accounts)
.environmentObject(instances)
.environmentObject(settings)
.environmentObject(navigation)
.environmentObject(player)
}
)
@@ -126,14 +130,6 @@ struct ContentView: View {
#endif
}
func openWelcomeScreenIfAccountEmpty() {
guard Defaults[.instances].isEmpty else {
return
}
navigation.presentingWelcomeScreen = true
}
var videoPlayer: some View {
VideoPlayerView()
.environmentObject(accounts)