mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-21 06:59:09 +00:00
chore(rundown): improve documentation of insert logic
This commit is contained in:
committed by
Carlos Valente
parent
5f040092cb
commit
8363f06a5c
@@ -60,6 +60,7 @@ export type EventOptions = Partial<{
|
|||||||
before: MaybeString;
|
before: MaybeString;
|
||||||
// options of entries of type OntimeEvent
|
// options of entries of type OntimeEvent
|
||||||
linkPrevious: boolean;
|
linkPrevious: boolean;
|
||||||
|
/** the timing reference for the new entry, usually the same as after */
|
||||||
lastEventId: MaybeString;
|
lastEventId: MaybeString;
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
@@ -205,8 +206,8 @@ function useEntryActionsForRundown(scopedRundownId: string | undefined) {
|
|||||||
|
|
||||||
// ************* CHECK OPTIONS specific to events
|
// ************* CHECK OPTIONS specific to events
|
||||||
if (isOntimeEvent(newEntry)) {
|
if (isOntimeEvent(newEntry)) {
|
||||||
|
// last event id is the timing reference of the previous OntimeEvent in rundown
|
||||||
if (options?.lastEventId) {
|
if (options?.lastEventId) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- we know this is a value
|
|
||||||
const previousEvent = rundownData.entries[options?.lastEventId];
|
const previousEvent = rundownData.entries[options?.lastEventId];
|
||||||
if (isOntimeEvent(previousEvent)) {
|
if (isOntimeEvent(previousEvent)) {
|
||||||
newEntry.timeStart = previousEvent.timeEnd;
|
newEntry.timeStart = previousEvent.timeEnd;
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ export function useRundownCommands({
|
|||||||
addEntry(patch, {
|
addEntry(patch, {
|
||||||
after: id && !above ? id : undefined,
|
after: id && !above ? id : undefined,
|
||||||
before: id && above ? id : undefined,
|
before: id && above ? id : undefined,
|
||||||
lastEventId: !above && id ? id : undefined,
|
lastEventId: id && !above ? id : undefined,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[addEntry],
|
[addEntry],
|
||||||
|
|||||||
Reference in New Issue
Block a user