From 8d9bbf647a6cacb6976edc71c021732eefb78dc5 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Mon, 6 Dec 2021 19:12:59 +0100 Subject: [PATCH] Fix disabling comments on tvOS --- Shared/Player/PlayerViewController.swift | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Shared/Player/PlayerViewController.swift b/Shared/Player/PlayerViewController.swift index 27b1a9cd..5dcc8970 100644 --- a/Shared/Player/PlayerViewController.swift +++ b/Shared/Player/PlayerViewController.swift @@ -45,11 +45,16 @@ final class PlayerViewController: UIViewController { #if os(tvOS) playerModel.avPlayerViewController = playerViewController - playerViewController.customInfoViewControllers = [ - infoViewController([.comments], title: "Comments"), + var infoViewControllers = [UIHostingController]() + if CommentsModel.enabled { + infoViewControllers.append(infoViewController([.comments], title: "Comments")) + } + infoViewControllers.append(contentsOf: [ infoViewController([.related], title: "Related"), infoViewController([.playingNext, .playedPreviously], title: "Playing Next") - ] + ]) + + playerViewController.customInfoViewControllers = infoViewControllers #else embedViewController() #endif