fix(extension): remove special case for JUMP_TO_STATE (#829)

This commit is contained in:
Nathan Bierema 2021-09-02 13:34:24 +00:00 committed by GitHub
parent cfba119c53
commit 855f22e14e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 14 deletions

View File

@ -2,10 +2,7 @@ import React, { Component } from 'react';
import { connect, ResolveThunks } from 'react-redux'; import { connect, ResolveThunks } from 'react-redux';
import { Button, Container, Divider, Toolbar } from 'devui'; import { Button, Container, Divider, Toolbar } from 'devui';
import SliderMonitor from '@redux-devtools/app/lib/containers/monitors/Slider'; import SliderMonitor from '@redux-devtools/app/lib/containers/monitors/Slider';
import { import { liftedDispatch, getReport } from '@redux-devtools/app/lib/actions';
liftedDispatch as liftedDispatchAction,
getReport,
} from '@redux-devtools/app/lib/actions';
import { getActiveInstance } from '@redux-devtools/app/lib/reducers/instances'; import { getActiveInstance } from '@redux-devtools/app/lib/reducers/instances';
import DevTools from '@redux-devtools/app/lib/containers/DevTools'; import DevTools from '@redux-devtools/app/lib/containers/DevTools';
import Dispatcher from '@redux-devtools/app/lib/containers/monitors/Dispatcher'; import Dispatcher from '@redux-devtools/app/lib/containers/monitors/Dispatcher';
@ -161,7 +158,7 @@ const mapStateToProps = (state: StoreState) => {
}; };
const actionCreators = { const actionCreators = {
liftedDispatch: liftedDispatchAction, liftedDispatch,
getReport, getReport,
}; };

View File

@ -426,13 +426,6 @@ function __REDUX_DEVTOOLS_EXTENSION__<S, A extends Action<unknown>>(
if (!features.lock && action.type === 'LOCK_CHANGES') return; if (!features.lock && action.type === 'LOCK_CHANGES') return;
if (!features.pause && action.type === 'PAUSE_RECORDING') return; if (!features.pause && action.type === 'PAUSE_RECORDING') return;
} }
if (action.type === 'JUMP_TO_STATE') {
const liftedState = store.liftedStore.getState();
const index = liftedState.stagedActionIds.indexOf(action.actionId);
if (index === -1) return;
store.liftedStore.dispatch({ type: action.type, index });
return;
}
store.liftedStore.dispatch(action as any); store.liftedStore.dispatch(action as any);
} }

View File

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { connect, ResolveThunks } from 'react-redux'; import { connect, ResolveThunks } from 'react-redux';
import { Container } from 'devui'; import { Container } from 'devui';
import SliderMonitor from './monitors/Slider'; import SliderMonitor from './monitors/Slider';
import { liftedDispatch as liftedDispatchAction, getReport } from '../actions'; import { liftedDispatch, getReport } from '../actions';
import { getActiveInstance } from '../reducers/instances'; import { getActiveInstance } from '../reducers/instances';
import DevTools from '../containers/DevTools'; import DevTools from '../containers/DevTools';
import Dispatcher from './monitors/Dispatcher'; import Dispatcher from './monitors/Dispatcher';
@ -69,7 +69,7 @@ const mapStateToProps = (state: StoreState) => {
}; };
const actionCreators = { const actionCreators = {
liftedDispatch: liftedDispatchAction, liftedDispatch,
getReport, getReport,
}; };