From f356afef43f890cefc48cbc16567322e47ff9b6b Mon Sep 17 00:00:00 2001 From: Carlos Valente Date: Mon, 28 Apr 2025 20:48:42 +0200 Subject: [PATCH] fix: rebase master --- .../event-editor/composite/EventEditorTriggers.tsx | 12 ++++++------ apps/server/src/stores/runtimeState.ts | 7 ++++++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/apps/client/src/features/rundown/event-editor/composite/EventEditorTriggers.tsx b/apps/client/src/features/rundown/event-editor/composite/EventEditorTriggers.tsx index 5aebb3841..1187833dc 100644 --- a/apps/client/src/features/rundown/event-editor/composite/EventEditorTriggers.tsx +++ b/apps/client/src/features/rundown/event-editor/composite/EventEditorTriggers.tsx @@ -5,7 +5,7 @@ import { TimerLifeCycle, timerLifecycleValues, Trigger } from 'ontime-types'; import { generateId } from 'ontime-utils'; import Tag from '../../../../common/components/tag/Tag'; -import { useEventAction } from '../../../../common/hooks/useEventAction'; +import { useEntryActions } from '../../../../common/hooks/useEntryAction'; import useAutomationSettings from '../../../../common/hooks-query/useAutomationSettings'; import { eventTriggerOptions } from './eventTrigger.constants'; @@ -37,7 +37,7 @@ interface EventTriggerFormProps { function EventTriggerForm(props: EventTriggerFormProps) { const { eventId, triggers } = props; const { data: automationSettings } = useAutomationSettings(); - const { updateEvent } = useEventAction(); + const { updateEntry } = useEntryActions(); const [automationId, setAutomationId] = useState(undefined); const [cycleValue, setCycleValue] = useState(TimerLifeCycle.onStart); @@ -45,7 +45,7 @@ function EventTriggerForm(props: EventTriggerFormProps) { const newTriggers = triggers ?? new Array(); const id = generateId(); newTriggers.push({ id, title: '', trigger: triggerLifeCycle, automationId }); - updateEvent({ id: eventId, triggers: newTriggers }); + updateEntry({ id: eventId, triggers: newTriggers }); }; const getValidationError = (cycle: TimerLifeCycle, automationId?: string): string | undefined => { @@ -123,15 +123,15 @@ interface ExistingEventTriggersProps { function ExistingEventTriggers(props: ExistingEventTriggersProps) { const { eventId, triggers } = props; - const { updateEvent } = useEventAction(); + const { updateEntry } = useEntryActions(); const { data: automationSettings } = useAutomationSettings(); const handleDelete = useCallback( (triggerId: string) => { const newTriggers = triggers.filter((trigger) => trigger.id !== triggerId); - updateEvent({ id: eventId, triggers: newTriggers }); + updateEntry({ id: eventId, triggers: newTriggers }); }, - [eventId, triggers, updateEvent], + [eventId, triggers, updateEntry], ); const filteredTriggers: Record = {}; diff --git a/apps/server/src/stores/runtimeState.ts b/apps/server/src/stores/runtimeState.ts index 0afca1b3e..cbce1fad6 100644 --- a/apps/server/src/stores/runtimeState.ts +++ b/apps/server/src/stores/runtimeState.ts @@ -4,6 +4,7 @@ import { isPlayableEvent, MaybeNumber, MaybeString, + OffsetMode, OntimeBlock, OntimeEvent, PlayableEvent, @@ -98,7 +99,7 @@ export function clearEventData() { runtimeState.runtime.selectedEventIndex = null; runtimeState.timer.playback = Playback.Stop; - runtimeState.clock = clock.timeNow(); + runtimeState.clock = timeNow(); runtimeState.timer = { ...runtimeStorePlaceholder.timer }; // when clearing, we maintain the total delay from the rundown @@ -749,3 +750,7 @@ export function loadBlock(rundown: Rundown, state = runtimeState) { const currentBlock = rundown.entries[currentBlockId]; state.currentBlock.block = currentBlock as OntimeBlock; } + +export function setOffsetMode(mode: OffsetMode) { + runtimeState.runtime.offsetMode = mode; +}