mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-13 19:33:46 +00:00
Feat resumability (#547)
* add resumability functionality --------- Co-authored-by: arc-alex <ac@omnivox.dk> Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
b34fe71995
commit
a84c0654e2
@@ -23,6 +23,18 @@ export class EventLoader {
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-this-alias -- this logic is used to ensure singleton
|
||||
instance = this;
|
||||
this.eventNow = null;
|
||||
this.publicEventNow = null;
|
||||
this.eventNext = null;
|
||||
this.publicEventNext = null;
|
||||
this.loaded = {
|
||||
selectedEventIndex: null,
|
||||
selectedEventId: null,
|
||||
selectedPublicEventId: null,
|
||||
nextEventId: null,
|
||||
nextPublicEventId: null,
|
||||
numEvents: 0,
|
||||
};
|
||||
}
|
||||
|
||||
// we need to delay init until the store is ready
|
||||
@@ -71,7 +83,7 @@ export class EventLoader {
|
||||
* @param {string} eventId
|
||||
* @return {object | undefined}
|
||||
*/
|
||||
static getEventWithId(eventId) {
|
||||
static getEventWithId(eventId): OntimeEvent | undefined {
|
||||
const timedEvents = EventLoader.getTimedEvents();
|
||||
return timedEvents.find((event) => event.id === eventId);
|
||||
}
|
||||
@@ -223,7 +235,7 @@ export class EventLoader {
|
||||
* loads an event given its id
|
||||
* @param {object} event
|
||||
*/
|
||||
loadEvent(event) {
|
||||
loadEvent(event?: OntimeEvent) {
|
||||
if (typeof event === 'undefined') {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user