mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Fix toolbar tabs
This commit is contained in:
@@ -8,6 +8,7 @@ struct VideoDetails: View {
|
||||
case info, inspector, chapters, comments, related, queue
|
||||
}
|
||||
|
||||
@Binding var page: DetailsPage
|
||||
@Binding var sidebarQueue: Bool
|
||||
@Binding var fullScreen: Bool
|
||||
var bottomPadding = false
|
||||
@@ -15,8 +16,6 @@ struct VideoDetails: View {
|
||||
@State private var subscribed = false
|
||||
@State private var subscriptionToggleButtonDisabled = false
|
||||
|
||||
@State private var page = DetailsPage.queue
|
||||
|
||||
@Environment(\.navigationStyle) private var navigationStyle
|
||||
#if os(iOS)
|
||||
@Environment(\.verticalSizeClass) private var verticalSizeClass
|
||||
@@ -84,7 +83,11 @@ struct VideoDetails: View {
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
page = sidebarQueue ? .inspector : .queue
|
||||
if video.isNil ||
|
||||
!VideoDetailsTool.find(for: page)!.isAvailable(for: video!, sidebarQueue: sidebarQueue)
|
||||
{
|
||||
page = .info
|
||||
}
|
||||
|
||||
guard video != nil, accounts.app.supportsSubscriptions else {
|
||||
subscribed = false
|
||||
@@ -243,7 +246,7 @@ struct VideoDetails: View {
|
||||
|
||||
struct VideoDetails_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
VideoDetails(sidebarQueue: .constant(true), fullScreen: .constant(false))
|
||||
VideoDetails(page: .constant(.info), sidebarQueue: .constant(true), fullScreen: .constant(false))
|
||||
.injectFixtureEnvironmentObjects()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user