From 2dff76a14683cfc817863740e855185c43c84ec0 Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Thu, 13 Apr 2023 23:06:55 +0100 Subject: [PATCH] Reuse PLAYER_ID_PREVIEW for preview player templating --- src/showplanner/Player.tsx | 12 ++++-------- src/showplanner/index.tsx | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/showplanner/Player.tsx b/src/showplanner/Player.tsx index cd10664..c5f1122 100644 --- a/src/showplanner/Player.tsx +++ b/src/showplanner/Player.tsx @@ -345,16 +345,12 @@ function LoadedTrackInfo({ id }: { id: number }) { ); } -export function Player({ - id, - isPreviewChannel, -}: { - id: number; - isPreviewChannel: boolean; -}) { +export function Player({ id }: { id: number }) { // Define time remaining (secs) when the play icon should flash. const SECS_REMAINING_WARNING = 20; + const isPreviewChannel = id === PLAYER_ID_PREVIEW; + // We want to force update the selector when we pass the SECS_REMAINING_WARNING barrier. const playerState = useSelector( (state: RootState) => state.mixer.players[id], @@ -620,7 +616,7 @@ export function PflPlayer() { Preview Player (Headphones Only) - + ); } diff --git a/src/showplanner/index.tsx b/src/showplanner/index.tsx index 205d52f..b5a343d 100644 --- a/src/showplanner/index.tsx +++ b/src/showplanner/index.tsx @@ -70,7 +70,7 @@ function Channel({ id, data }: { id: number; data: PlanItem[] }) { )} - + ); }