Skip to content

Commit

Permalink
also report roll events
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-Arc committed Feb 1, 2025
1 parent 9ce972f commit 619ef3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 2 additions & 3 deletions apps/server/src/api-data/report/report.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export function getWithId(id: string): OntimeEventReport | null {
* @param id optional id of a event report to clear
*/
export function clear(id?: string) {
console.log('clear report',id)
formattedReport = null;
if (id) {
report.delete(id);
Expand All @@ -47,7 +46,7 @@ export function clear(id?: string) {
}
}

export function eventStart(state: RuntimeState) {
export function eventStart(state: Readonly<RuntimeState>) {
formattedReport = null;
if (state.eventNow === null) {
// eslint-disable-next-line no-unused-labels -- dev code path
Expand All @@ -61,7 +60,7 @@ export function eventStart(state: RuntimeState) {
report.set(state.eventNow.id, { ...blankReportData, startedAt: state.timer.startedAt });
}

export function eventStop(state: RuntimeState) {
export function eventStop(state: Readonly<RuntimeState>) {
formattedReport = null;
if (state.eventNow === null) {
// This is normal and happens every time we call load
Expand Down
2 changes: 2 additions & 0 deletions apps/server/src/stores/runtimeState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ export function roll(rundown: OntimeRundown, offset = 0): { eventId: MaybeString
runtimeState.runtime.actualStart = runtimeState.clock;
}
runtimeState.timer.secondaryTimer = null;
report.eventStart(runtimeState);
} else {
runtimeState._timer.secondaryTarget = normaliseRollStart(runtimeState.eventNow.timeStart, offsetClock);
runtimeState.timer.secondaryTimer = runtimeState._timer.secondaryTarget - offsetClock;
Expand Down Expand Up @@ -698,6 +699,7 @@ export function roll(rundown: OntimeRundown, offset = 0): { eventId: MaybeString

// update runtime
runtimeState.runtime.actualStart = runtimeState.clock;
report.eventStart(runtimeState);
return { eventId: runtimeState.eventNow.id, didStart: true };
}

Expand Down

0 comments on commit 619ef3c

Please sign in to comment.