diff --git a/src/app/store/configureStore.js b/src/app/store/configureStore.js index 37bff071..32cd9edc 100644 --- a/src/app/store/configureStore.js +++ b/src/app/store/configureStore.js @@ -4,7 +4,7 @@ import { persistState, instrument } from 'redux-devtools'; export default function configureStore(next, subscriber = () => ({}), options = {}) { const { deserializeState, deserializeAction } = options; return compose( - instrument(subscriber), + instrument(subscriber, window.devToolsOptions), persistState( getPersistSession(), deserializeState, diff --git a/src/browser/extension/inject/pageScript.js b/src/browser/extension/inject/pageScript.js index cb02ccc7..dd6bd475 100644 --- a/src/browser/extension/inject/pageScript.js +++ b/src/browser/extension/inject/pageScript.js @@ -42,13 +42,14 @@ window.devToolsExtension = function(config = {}) { window.postMessage(message, '*'); } - function relay(type, state, action, nextActionId) { + function relay(type, state, action, nextActionId, isExcess) { setTimeout(() => { const message = { payload: type === 'STATE' && shouldFilter() ? filterActions(state) : state, action: action || '', nextActionId: nextActionId || '', - type: type, + isExcess, + type, source: 'redux-page', name: config.name || document.title }; @@ -155,7 +156,9 @@ window.devToolsExtension = function(config = {}) { relay('INIT', state, { timestamp: Date.now() }); } else if (!errorOccurred && monitorActions.indexOf(lastAction) === -1) { if (lastAction === 'JUMP_TO_STATE' || shouldFilter() && isFiltered(action)) return; - relay('ACTION', state, liftedAction, nextActionId); + const { maxAge } = window.devToolsOptions; + const isExcess = maxAge && liftedState.stagedActionIds.length === maxAge; + relay('ACTION', state, liftedAction, nextActionId, isExcess); } else { if (errorOccurred && !liftedState.computedStates[liftedState.currentStateIndex].error) errorOccurred = false; relay('STATE', liftedState); diff --git a/src/browser/extension/options/index.js b/src/browser/extension/options/index.js index 366b6030..b22106ed 100644 --- a/src/browser/extension/options/index.js +++ b/src/browser/extension/options/index.js @@ -8,7 +8,9 @@ chrome.runtime.getBackgroundPage( background => { const saveOption = e => { let value; if (e.target.type === 'checkbox') value = e.target.checked; - else if (e.target.type === 'input') value = Number(e.target.value); + else if ( + e.target.type === 'input' || e.target.type === 'text' + ) value = Number(e.target.value); else value = e.target.value; syncOptions.save(e.target.id, value); }; @@ -48,7 +50,7 @@ chrome.runtime.getBackgroundPage( background => {