style: editor tweaks (#736)

* style: menu tweaks

* style: editor tweaks

* style: freeze
This commit is contained in:
Carlos Valente
2024-01-26 14:47:27 +01:00
committed by GitHub
parent c146954a2f
commit f6557a9814
32 changed files with 178 additions and 249 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ export class TimerService {
* @param {number} amount
*/
addTime(amount: number) {
if (state.eventNow === null) {
if (state.timer.current === null) {
return;
}
stateMutations.timer.addTime(amount);
@@ -340,7 +340,30 @@ describe('getCurrent()', () => {
const current = getCurrent(state);
expect(current).toBe(35);
});
describe('on timers of type time-to-end', () => {
it('current time is the time to end even if it hasnt started, this is weird, but by design', () => {
const state = {
eventNow: {
timeEnd: 100,
timerType: TimerType.TimeToEnd,
},
clock: 30,
timer: {
addedTime: 0,
duration: 100,
startedAt: null,
finishedAt: null,
},
_timer: {
pausedAt: null,
},
} as TState;
const current = getCurrent(state);
expect(current).toBe(70);
});
it('current time is the time to end', () => {
const state = {
eventNow: {
@@ -1,4 +1,12 @@
import { LogOrigin, OntimeBaseEvent, OntimeBlock, OntimeDelay, OntimeEvent, SupportedEvent, isOntimeEvent } from 'ontime-types';
import {
LogOrigin,
OntimeBaseEvent,
OntimeBlock,
OntimeDelay,
OntimeEvent,
SupportedEvent,
isOntimeEvent,
} from 'ontime-types';
import { generateId, getCueCandidate } from 'ontime-utils';
import { DataProvider } from '../../classes/data-provider/DataProvider.js';
import { block as blockDef, delay as delayDef } from '../../models/eventsDefinition.js';