mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-18 21:54:09 +00:00
fix: apply delay (#494)
* fix: bug with applying delays * fix: show delay data only in production screens * chore: cover delay with feature test * refactor: simplify type assertion
This commit is contained in:
@@ -46,5 +46,6 @@ export type { TitleBlock } from './definitions/runtime/TitleBlock.type.js';
|
||||
|
||||
// CLIENT
|
||||
|
||||
// UTILITY TYPES
|
||||
// TYPE UTILITIES
|
||||
export { isOntimeBlock, isOntimeDelay, isOntimeEvent } from './utils/guards.js';
|
||||
export type { MaybeNumber } from './utils/utils.type.js';
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import { OntimeRundownEntry } from '../definitions/core/Rundown.type.js';
|
||||
import { OntimeBlock, OntimeDelay, OntimeEvent, SupportedEvent } from '../definitions/core/OntimeEvent.type.js';
|
||||
|
||||
export function isOntimeEvent(event: OntimeRundownEntry | Partial<OntimeRundownEntry>): event is OntimeEvent {
|
||||
return event.type === SupportedEvent.Event;
|
||||
}
|
||||
|
||||
export function isOntimeDelay(event: OntimeRundownEntry | Partial<OntimeRundownEntry>): event is OntimeDelay {
|
||||
return event.type === SupportedEvent.Delay;
|
||||
}
|
||||
|
||||
export function isOntimeBlock(event: OntimeRundownEntry | Partial<OntimeRundownEntry>): event is OntimeBlock {
|
||||
return event.type === SupportedEvent.Block;
|
||||
}
|
||||
Reference in New Issue
Block a user