mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 04:43:35 +00:00
style: editor tweaks (#736)
* style: menu tweaks * style: editor tweaks * style: freeze
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user