Fix types

This commit is contained in:
Nathan Bierema 2022-01-06 21:48:09 -05:00
parent 4b558ae15a
commit 93b7f71c8e
2 changed files with 2 additions and 6 deletions

View File

@ -104,11 +104,9 @@ export interface MonitorActionAction {
export interface JumpToStateAction {
type: 'JUMP_TO_STATE';
index: number;
actionId: number;
}
export interface JumpToActionAction {
type: 'JUMP_TO_ACTION';
index: number;
actionId: number;
}
export interface PauseRecordingAction {

View File

@ -217,10 +217,8 @@ export function dispatchAction(
if (action.type === 'JUMP_TO_STATE' || action.type === 'JUMP_TO_ACTION') {
const id = state.selected || state.current;
const liftedState = state.states[id];
let currentStateIndex = action.index;
if (typeof currentStateIndex === 'undefined' && action.actionId != null) {
currentStateIndex = liftedState.stagedActionIds.indexOf(action.actionId);
}
const currentStateIndex =
action.type === 'JUMP_TO_STATE' ? action.index : action.actionId;
return {
...state,
states: {