fix(start): do not add extra history item when choosing start page

This commit is contained in:
vladikoff 2019-01-23 22:22:49 -05:00
Родитель ba03e88768
Коммит 25312a4f79
2 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -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}));
}); });
}); });