From c745b0fb22a3aea98a29e6e4a29298f5ed518fad Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sun, 26 Jun 2022 13:31:14 +0200 Subject: [PATCH] Details improvements --- Shared/Player/VideoDetails.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Shared/Player/VideoDetails.swift b/Shared/Player/VideoDetails.swift index 801894be..706b1743 100644 --- a/Shared/Player/VideoDetails.swift +++ b/Shared/Player/VideoDetails.swift @@ -68,7 +68,7 @@ struct VideoDetails: View { pageButton("Chapters", "bookmark", .chapters, !(video?.chapters.isEmpty ?? true)) pageButton("Comments", "text.bubble", .comments, !video.isNil) { comments.load() } pageButton("Related", "rectangle.stack.fill", .related, !video.isNil) - pageButton("Queue", "list.number", .queue, !video.isNil) + pageButton("Queue", "list.number", .queue, !player.queue.isEmpty) } .onChange(of: player.currentItem) { _ in page.update(.moveToFirst) @@ -77,7 +77,11 @@ struct VideoDetails: View { .padding(.vertical, 6) Pager(page: page, data: DetailsPage.allCases, id: \.self) { - detailsByPage($0) + if !player.currentItem.isNil || page.index == DetailsPage.queue.index { + detailsByPage($0) + } else { + VStack {} + } } .onPageWillChange { pageIndex in if pageIndex == DetailsPage.comments.index {