diff --git a/Sora/SoraApp.swift b/Sora/SoraApp.swift index 802c3b7..86ddd7d 100644 --- a/Sora/SoraApp.swift +++ b/Sora/SoraApp.swift @@ -31,24 +31,30 @@ struct SoraApp: App { var body: some Scene { WindowGroup { - SplashScreenView() - .environmentObject(moduleManager) - .environmentObject(settings) - .environmentObject(librarykManager) - .environmentObject(downloadManager) - .environmentObject(jsController) - .accentColor(settings.accentColor) - .onAppear { - settings.updateAppearance() - Task { - if UserDefaults.standard.bool(forKey: "refreshModulesOnLaunch") { - await moduleManager.refreshModules() - } + Group { + if !UserDefaults.standard.bool(forKey: "hideSplashScreenEnable") { + SplashScreenView() + } else { + ContentView() + } + } + .environmentObject(moduleManager) + .environmentObject(settings) + .environmentObject(librarykManager) + .environmentObject(downloadManager) + .environmentObject(jsController) + .accentColor(settings.accentColor) + .onAppear { + settings.updateAppearance() + Task { + if UserDefaults.standard.bool(forKey: "refreshModulesOnLaunch") { + await moduleManager.refreshModules() } } - .onOpenURL { url in - handleURL(url) - } + } + .onOpenURL { url in + handleURL(url) + } } } diff --git a/Sora/Views/SettingsView/SettingsSubViews/SettingsViewGeneral.swift b/Sora/Views/SettingsView/SettingsSubViews/SettingsViewGeneral.swift index 331f3da..8510192 100644 --- a/Sora/Views/SettingsView/SettingsSubViews/SettingsViewGeneral.swift +++ b/Sora/Views/SettingsView/SettingsSubViews/SettingsViewGeneral.swift @@ -153,6 +153,7 @@ struct SettingsViewGeneral: View { @AppStorage("refreshModulesOnLaunch") private var refreshModulesOnLaunch: Bool = true @AppStorage("fetchEpisodeMetadata") private var fetchEpisodeMetadata: Bool = true @AppStorage("analyticsEnabled") private var analyticsEnabled: Bool = false + @AppStorage("hideSplashScreenEnable") private var hideSplashScreenEnable: Bool = false @AppStorage("metadataProviders") private var metadataProviders: String = "TMDB" @AppStorage("tmdbImageWidth") private var TMDBimageWidht: String = "original" @AppStorage("mediaColumnsPortrait") private var mediaColumnsPortrait: Int = 2 @@ -180,6 +181,12 @@ struct SettingsViewGeneral: View { }, selection: $settings.selectedAppearance ) + + SettingsToggleRow( + icon: "wand.and.rays.inverse", + title: "Hide Splash Screen", + isOn: $hideSplashScreenEnable + ) } SettingsSection( diff --git a/Sora/Views/SplashScreenView.swift b/Sora/Views/SplashScreenView.swift index c906161..4833ac6 100644 --- a/Sora/Views/SplashScreenView.swift +++ b/Sora/Views/SplashScreenView.swift @@ -24,18 +24,13 @@ struct SplashScreenView: View { .cornerRadius(24) .scaleEffect(isAnimating ? 1.2 : 1.0) .opacity(isAnimating ? 1.0 : 0.0) - - Text("Sora") - .font(.largeTitle) - .fontWeight(.bold) - .opacity(isAnimating ? 1.0 : 0.0) } .onAppear { withAnimation(.easeIn(duration: 0.5)) { isAnimating = true } - DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { + DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) { withAnimation(.easeOut(duration: 0.5)) { showMainApp = true }