fix(start): do not add extra history item when choosing start page
This commit is contained in:
Родитель
ba03e88768
Коммит
25312a4f79
|
@ -571,7 +571,11 @@ Start.prototype = {
|
||||||
// pushState must be specified or else no screen transitions occur.
|
// pushState must be specified or else no screen transitions occur.
|
||||||
this._history.start({ pushState: this._canUseHistoryAPI(), silent: isSilent });
|
this._history.start({ pushState: this._canUseHistoryAPI(), silent: isSilent });
|
||||||
if (startPage) {
|
if (startPage) {
|
||||||
this._router.navigate(startPage);
|
this._router.navigate(startPage, {}, {
|
||||||
|
// do not add a history item for the page that was there BEFORE the selected start page.
|
||||||
|
replace: true,
|
||||||
|
trigger: true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -162,10 +162,10 @@ define(function (require, exports, module) {
|
||||||
sandbox.restore();
|
sandbox.restore();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('redirects to /cookies_disabled', () => {
|
it('redirects to /cookies_disabled without history replace or trigger', () => {
|
||||||
return appStart.startApp()
|
return appStart.startApp()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
assert.isTrue(routerMock.navigate.calledWith('cookies_disabled'));
|
assert.isTrue(routerMock.navigate.calledWith('cookies_disabled', {}, {replace: true, trigger: true}));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче