mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 02:13:48 +00:00
refactor: rename external message to secondary message
This commit is contained in:
committed by
Carlos Valente
parent
0aeec12ccd
commit
3cd6cd2f55
@@ -59,7 +59,7 @@ export default function Timer(props: TimerProps) {
|
||||
hideCards,
|
||||
hideProgress,
|
||||
hideMessage,
|
||||
hideExternal,
|
||||
hideSecondary,
|
||||
hideTimerSeconds,
|
||||
removeLeadingZeros,
|
||||
mainSource,
|
||||
@@ -110,7 +110,7 @@ export default function Timer(props: TimerProps) {
|
||||
localisedMinutes,
|
||||
hideTimerSeconds,
|
||||
removeLeadingZeros,
|
||||
hideExternal,
|
||||
hideSecondary,
|
||||
);
|
||||
|
||||
// gather presentation styles
|
||||
|
||||
@@ -99,8 +99,8 @@ export const getTimerOptions = (timeFormat: string, customFields: CustomFields):
|
||||
defaultValue: false,
|
||||
},
|
||||
{
|
||||
id: 'hideExternal',
|
||||
title: 'Hide Auxiliary timer / External message',
|
||||
id: 'hideSecondary',
|
||||
title: 'Hide Auxiliary timer / Secondary message',
|
||||
description: 'Prevents the screen from displaying the secondary timer field',
|
||||
type: 'boolean',
|
||||
defaultValue: false,
|
||||
@@ -115,7 +115,7 @@ type TimerOptions = {
|
||||
hideCards: boolean;
|
||||
hideProgress: boolean;
|
||||
hideMessage: boolean;
|
||||
hideExternal: boolean;
|
||||
hideSecondary: boolean;
|
||||
hideTimerSeconds: boolean;
|
||||
removeLeadingZeros: boolean;
|
||||
mainSource: keyof OntimeEvent | null;
|
||||
@@ -135,7 +135,7 @@ function getOptionsFromParams(searchParams: URLSearchParams): TimerOptions {
|
||||
hideCards: isStringBoolean(searchParams.get('hideCards')),
|
||||
hideProgress: isStringBoolean(searchParams.get('hideProgress')),
|
||||
hideMessage: isStringBoolean(searchParams.get('hideMessage')),
|
||||
hideExternal: isStringBoolean(searchParams.get('hideExternal')),
|
||||
hideSecondary: isStringBoolean(searchParams.get('hideSecondary')),
|
||||
hideTimerSeconds: isStringBoolean(searchParams.get('hideTimerSeconds')),
|
||||
removeLeadingZeros: !isStringBoolean(searchParams.get('showLeadingZeros')),
|
||||
|
||||
|
||||
@@ -111,9 +111,9 @@ export function getSecondaryDisplay(
|
||||
localisedMinutes: string,
|
||||
removeSeconds: boolean,
|
||||
removeLeadingZero: boolean,
|
||||
hideExternal: boolean,
|
||||
hideSecondary: boolean,
|
||||
): string | undefined {
|
||||
if (hideExternal) {
|
||||
if (hideSecondary) {
|
||||
return;
|
||||
}
|
||||
if (message.timer.secondarySource === 'aux') {
|
||||
@@ -122,8 +122,8 @@ export function getSecondaryDisplay(
|
||||
removeLeadingZero,
|
||||
});
|
||||
}
|
||||
if (message.timer.secondarySource === 'external' && message.external) {
|
||||
return message.external;
|
||||
if (message.timer.secondarySource === 'secondary' && message.secondary) {
|
||||
return message.secondary;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user