mirror of
https://github.com/jellyfin/Swiftfin.git
synced 2024-12-13 00:47:33 +00:00
Fix appearance color bug
This commit is contained in:
parent
a0562e9e9d
commit
b5b2eb56a1
@ -7,6 +7,7 @@
|
||||
* Copyright 2021 Aiden Vigue & Jellyfin Contributors
|
||||
*/
|
||||
|
||||
import SwiftUI
|
||||
import UIKit
|
||||
|
||||
class AppDelegate: NSObject, UIApplicationDelegate {
|
||||
@ -17,16 +18,10 @@ class AppDelegate: NSObject, UIApplicationDelegate {
|
||||
// Lazily initialize datastack
|
||||
let _ = SwiftfinStore.dataStack
|
||||
|
||||
setupAppearance()
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
|
||||
AppDelegate.orientationLock
|
||||
}
|
||||
|
||||
private func setupAppearance() {
|
||||
// UIApplication.shared.windows.first?.overrideUserInterfaceStyle = appAppearance.style
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,12 @@ struct JellyfinPlayerApp: App {
|
||||
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
EmptyView()
|
||||
// TODO: Replace with a SplashView
|
||||
Color(appAppearance.style == .dark ? UIColor.black : UIColor.white)
|
||||
.ignoresSafeArea()
|
||||
.onAppear {
|
||||
setupAppearance()
|
||||
}
|
||||
.withHostingWindow { window in
|
||||
window?.rootViewController = PreferenceUIHostingController(wrappedView: MainCoordinator().view())
|
||||
}
|
||||
@ -30,6 +35,10 @@ struct JellyfinPlayerApp: App {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func setupAppearance() {
|
||||
UIApplication.shared.windows.first?.overrideUserInterfaceStyle = appAppearance.style
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Hosting Window
|
||||
|
Loading…
Reference in New Issue
Block a user