mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-09 01:13:55 +00:00
refactor: refetch targets is enum
This commit is contained in:
committed by
Carlos Valente
parent
256755bf02
commit
9f27832b29
@@ -1,5 +1,10 @@
|
||||
import { socket } from './WebsocketAdapter.js';
|
||||
|
||||
export enum RefetchTargets {
|
||||
Rundown = 'rundown',
|
||||
Report = 'report',
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility function to notify clients that the REST data is stale
|
||||
* @param payload -- possible patch payload
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { OntimeReport, OntimeEventReport, TimerLifeCycle } from 'ontime-types';
|
||||
import { RuntimeState } from '../../stores/runtimeState.js';
|
||||
import { sendRefetch } from '../../adapters/websocketAux.js';
|
||||
import { RefetchTargets, sendRefetch } from '../../adapters/websocketAux.js';
|
||||
import { DeepReadonly } from 'ts-essentials';
|
||||
|
||||
const report = new Map<string, OntimeEventReport>();
|
||||
@@ -58,7 +58,7 @@ export function triggerReportEntry(
|
||||
report.set(eventId, { startedAt, endedAt: state.clock });
|
||||
formattedReport = null;
|
||||
sendRefetch({
|
||||
target: 'REPORT',
|
||||
target: RefetchTargets.Report,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
import { getCueCandidate } from 'ontime-utils';
|
||||
|
||||
import { delay as delayDef } from '../../models/eventsDefinition.js';
|
||||
import { sendRefetch } from '../../adapters/websocketAux.js';
|
||||
import { RefetchTargets, sendRefetch } from '../../adapters/websocketAux.js';
|
||||
import { createBlock, createEvent } from '../../api-data/rundown/rundown.utils.js';
|
||||
import { updateRundownData } from '../../stores/runtimeState.js';
|
||||
import { runtimeService } from '../runtime-service/RuntimeService.js';
|
||||
@@ -334,7 +334,7 @@ function notifyChanges(options: NotifyChangesOptions) {
|
||||
if (options.external) {
|
||||
// advice socket subscribers of change
|
||||
const payload = {
|
||||
target: 'RUNDOWN',
|
||||
target: RefetchTargets.Rundown,
|
||||
changes: Array.isArray(options.timer) ? options.timer : undefined,
|
||||
reload: options.reload,
|
||||
revision: cache.getMetadata().revision,
|
||||
|
||||
Reference in New Issue
Block a user