diff --git a/src/ui/public/kibi/session/kibi_session.js b/src/ui/public/kibi/session/kibi_session.js index 0d4ac7960..eca6c21d4 100644 --- a/src/ui/public/kibi/session/kibi_session.js +++ b/src/ui/public/kibi/session/kibi_session.js @@ -20,10 +20,10 @@ UiModules.get('kibana') sessionStorage.setItem('kibiSession', JSON.stringify(res.data.kibiSession)); kibiSession.emit('kibisession:loaded'); } - let target = res.data.url; + let target = chrome.getBasePath() + res.data.url; if (res.data.url && config.get('state:storeInSessionStorage')) { try { - target = hashUrl(res.data.url); + target = chrome.getBasePath() + hashUrl(res.data.url); } catch (error) { notify.error(error); target = null; diff --git a/src/ui/public/kibi/state_management/kibi_state.js b/src/ui/public/kibi/state_management/kibi_state.js index 6219b38f8..1cd65ca06 100644 --- a/src/ui/public/kibi/state_management/kibi_state.js +++ b/src/ui/public/kibi/state_management/kibi_state.js @@ -53,11 +53,7 @@ define(function (require) { } }); - // Do not call save() method to prevent sending events - // persist the state in the URL - const search = $location.search(); - search[this._urlParam] = this.toRISON(); - $location.search(search).replace(); + this.save(true, true); } }).catch(notify.error); }); diff --git a/src/ui/public/state_management/state.js b/src/ui/public/state_management/state.js index 7ab5e61c7..0934990b3 100644 --- a/src/ui/public/state_management/state.js +++ b/src/ui/public/state_management/state.js @@ -116,7 +116,7 @@ export default function StateProvider(createNotifier, Private, $rootScope, $loca * Saves the state to the url * @returns {void} */ - State.prototype.save = function (replace) { + State.prototype.save = function (replace, silent) { // kibi: added silent parameter let stash = this._readFromURL(); let state = this.toObject(); replace = replace || false; @@ -129,7 +129,7 @@ export default function StateProvider(createNotifier, Private, $rootScope, $loca // apply diff to state from stash, will change state in place via side effect let diffResults = applyDiff(stash, _.defaults({}, state, this._defaults)); - if (diffResults.keys.length) { + if (diffResults.keys.length && !silent) { // kibi: do not send events if silent is set this.emit('save_with_changes', diffResults.keys); }