mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 12:53:32 +00:00
refactor: roll handover (#451)
* style: tweak active colour * refactor: create shared playback validation * feat: allow handover from and to roll
This commit is contained in:
@@ -3,3 +3,4 @@ export { formatFromMillis } from './src/date-utils/formatFromMillis.js';
|
||||
export { isTimeString } from './src/date-utils/isTimeString.js';
|
||||
export { millisToString } from './src/date-utils/millisToString.js';
|
||||
export { generateId } from './src/generate-id/generateId.js';
|
||||
export { validatePlayback } from './src/validate-action/validatePlayback.js';
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
"eslint-config-prettier": "^8.6.0",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"eslint-plugin-simple-import-sort": "^8.0.0",
|
||||
"ontime-types": "workspace:*",
|
||||
"prettier": "^2.8.3",
|
||||
"typescript": "^4.9.4",
|
||||
"vitest": "^0.30.1"
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import { Playback } from 'ontime-types';
|
||||
|
||||
export function validatePlayback(currentPlayback: Playback) {
|
||||
return {
|
||||
start: currentPlayback !== Playback.Stop,
|
||||
pause: currentPlayback === Playback.Play || currentPlayback === Playback.Roll,
|
||||
roll: true,
|
||||
stop: currentPlayback !== Playback.Stop,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user