diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/gitbook-core/src/actions/history.js | 1 | ||||
-rw-r--r-- | packages/gitbook-core/src/reducers/history.js | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/packages/gitbook-core/src/actions/history.js b/packages/gitbook-core/src/actions/history.js index a7cf228..1c33f4a 100644 --- a/packages/gitbook-core/src/actions/history.js +++ b/packages/gitbook-core/src/actions/history.js @@ -14,7 +14,6 @@ const SUPPORTED = ( */ function activate() { return (dispatch, getState) => { - dispatch({ type: ACTION_TYPES.HISTORY_ACTIVATE, listener: (location) => { diff --git a/packages/gitbook-core/src/reducers/history.js b/packages/gitbook-core/src/reducers/history.js index d78b158..8d2a2fb 100644 --- a/packages/gitbook-core/src/reducers/history.js +++ b/packages/gitbook-core/src/reducers/history.js @@ -1,6 +1,7 @@ const { Record, List } = require('immutable'); const { createBrowserHistory, createMemoryHistory } = require('history'); const ACTION_TYPES = require('../actions/TYPES'); +const Location = require('../models/Location'); const isServerSide = (typeof window === 'undefined'); @@ -45,6 +46,8 @@ function reduceHistory(state, action) { // We can't use .merge since it convert history to an immutable const newState = state + // TODO: we should find a way to have the correct location on server side + .set('location', isServerSide ? new Location() : Location.fromNative(window.location)) .set('client', client) .set('unlisten', unlisten); |