Skip to content

Commit

Permalink
Fix compilation on tvOS
Browse files Browse the repository at this point in the history
  • Loading branch information
imxieyi committed Jun 6, 2024
1 parent 3e99f09 commit c46b865
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Shared/UI/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ struct ContentView: View {
@State var localFileUrl: URL = URL(fileURLWithPath: "file:///")
@State var playerViewItem: PlayerViewItem? = nil
@State var showFileImporter = false
#if !os(tvOS)
@State var originalOrientation: UIInterfaceOrientation?
#endif

@StateObject var config = UserConfig()

Expand Down Expand Up @@ -182,6 +184,7 @@ struct ContentView: View {
#endif
}
}
#if !os(tvOS)
.onAppear {
originalOrientation = (UIApplication.shared.connectedScenes.first as! UIWindowScene).interfaceOrientation
if config.forceLandscape {
Expand All @@ -199,6 +202,7 @@ struct ContentView: View {
UIViewController.attemptRotationToDeviceOrientation()
}
}
#endif
}
}

Expand Down

0 comments on commit c46b865

Please sign in to comment.