Alpha revision (#811)

* style: less space for direction button

* chore: cleanup unused

* refactor: prevent CSS pollution

* refactor: force render on swatch

* refactor: force render on swatch

* refactor: improve import of blocks and skip import

* chore: remove unused

* chore: clarify effect

* chore: updata dataset

* fix: integrations not triggering

* chore: remove unused

* fix: onair derives from playback

* fix: gap day after
This commit is contained in:
Carlos Valente
2024-03-12 21:30:16 +01:00
committed by GitHub
parent 63983fc39a
commit 12d9e5922c
27 changed files with 554 additions and 217 deletions
+5 -2
View File
@@ -1,4 +1,4 @@
import { OntimeEvent, RuntimeStore } from 'ontime-types';
import { OntimeEvent, Playback, RuntimeStore } from 'ontime-types';
import { deepEqual } from 'fast-equals';
@@ -149,7 +149,10 @@ function broadcastResult(_target: any, _propertyKey: string, descriptor: Propert
const hasImmediateChanges = hasNewLoaded || hasSkippedBack || justStarted || hasChangedPlayback;
if (hasImmediateChanges || (isTimeToUpdate && !deepEqual(TimerService.previousState?.timer, state.timer))) {
eventStore.set('timer', state.timer);
eventStore.batchSet({
timer: state.timer,
onAir: state.timer.playback !== Playback.Stop,
});
TimerService.previousState.timer = { ...state.timer };
}
@@ -1518,7 +1518,7 @@ describe('getRuntimeOffset()', () => {
secondaryTimer: null,
startedAt: null,
},
_timer: { pausedAt: null, secondaryTarget: null, finishedNow: false },
_timer: { pausedAt: null, secondaryTarget: null },
} as RuntimeState;
const offset = getRuntimeOffset(state);
@@ -1570,7 +1570,7 @@ describe('getRuntimeOffset()', () => {
secondaryTimer: null,
startedAt: null,
},
_timer: { pausedAt: null, secondaryTarget: null, finishedNow: false },
_timer: { pausedAt: null, secondaryTarget: null },
} as RuntimeState;
const offset = getRuntimeOffset(state);
@@ -1622,7 +1622,7 @@ describe('getRuntimeOffset()', () => {
secondaryTimer: null,
startedAt: 78000000,
},
_timer: { pausedAt: null, secondaryTarget: null, finishedNow: false },
_timer: { pausedAt: null, secondaryTarget: null },
} as RuntimeState;
const offset = getRuntimeOffset(state);
@@ -1674,7 +1674,7 @@ describe('getRuntimeOffset()', () => {
secondaryTimer: null,
startedAt: 78000000,
},
_timer: { pausedAt: null, secondaryTarget: null, finishedNow: false },
_timer: { pausedAt: null, secondaryTarget: null },
} as RuntimeState;
const offset = getRuntimeOffset(state);
@@ -34,7 +34,7 @@ export class HttpIntegration implements IIntegration<HttpSubscription> {
dispatch(action: TimerLifeCycleKey, state?: object) {
// noop
if (!this.enabled || !action) {
if (!this.enabled) {
return;
}
@@ -64,7 +64,7 @@ export class OscIntegration implements IIntegration<OscSubscription> {
dispatch(action: TimerLifeCycleKey, state?: object) {
// noop
if (!this.oscClient || !action) {
if (!this.oscClient) {
return;
}
@@ -29,7 +29,6 @@ class RuntimeService {
/** Checks result of an update and notifies integrations as needed */
checkTimerUpdate({ shouldCallRoll, hasTimerFinished }: runtimeState.UpdateResult) {
const newState = runtimeState.getState();
if (hasTimerFinished) {
integrationService.dispatch(TimerLifeCycle.onFinish);
@@ -37,11 +36,11 @@ class RuntimeService {
// actions are added to the queue stack to ensure that the order of operations is maintained
if (newState.timer.playback === Playback.Play && newState.eventNow) {
if (newState.eventNow.endAction === EndAction.Stop) {
setTimeout(this.stop, 0);
setTimeout(this.stop.bind(this), 0);
} else if (newState.eventNow.endAction === EndAction.LoadNext) {
setTimeout(this.loadNext, 0);
setTimeout(this.loadNext.bind(this), 0);
} else if (newState.eventNow.endAction === EndAction.PlayNext) {
setTimeout(this.startNext, 0);
setTimeout(this.startNext.bind(this), 0);
}
}
}