Skip to content

Commit 1277947

Browse files
committed
Jump over filtered actions when time travelling
1 parent 98aec29 commit 1277947

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/app/middlewares/api.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ function toMonitors(action, tabId, verbose) {
2727
});
2828
}
2929

30-
function toContentScript({ message, action, id, instanceId, state }) {
30+
function toContentScript({ message, action, id, instanceId }) {
3131
connections.tab[id].postMessage({
3232
type: message,
3333
action,
34-
state: nonReduxDispatch(window.store, message, instanceId, action, state),
34+
state: nonReduxDispatch(window.store, message, instanceId, action),
3535
id: instanceId
3636
});
3737
}

src/browser/extension/inject/pageScript.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,22 @@ const devToolsExtension = function(reducer, preloadedState, config) {
172172
}
173173
}
174174

175+
function dispatchMonitorAction(action) {
176+
const type = action.type;
177+
if (type === 'JUMP_TO_STATE') {
178+
const liftedState = store.liftedStore.getState();
179+
const index = liftedState.stagedActionIds.indexOf(action.actionId);
180+
if (index === -1) return;
181+
store.liftedStore.dispatch({ type, index });
182+
return;
183+
}
184+
store.liftedStore.dispatch(action);
185+
}
186+
175187
function onMessage(message) {
176188
switch (message.type) {
177189
case 'DISPATCH':
178-
store.liftedStore.dispatch(message.payload);
190+
dispatchMonitorAction(message.payload);
179191
return;
180192
case 'ACTION':
181193
dispatchRemotely(message.payload);

0 commit comments

Comments
 (0)