fix: #36322 HistoryWrapper constructor history param not work (#36367)

This commit is contained in:
MeetzhDing
2021-07-03 00:19:58 +08:00
committed by GitHub
parent b26b922658
commit 63715dcdef

View File

@@ -31,9 +31,10 @@ export class HistoryWrapper implements LocationService {
constructor(history?: H.History) {
// If no history passed create an in memory one if being called from test
this.history =
history || process.env.NODE_ENV === 'test'
history ||
(process.env.NODE_ENV === 'test'
? H.createMemoryHistory({ initialEntries: ['/'] })
: H.createBrowserHistory({ basename: config.appSubUrl ?? '/' });
: H.createBrowserHistory({ basename: config.appSubUrl ?? '/' }));
this.partial = this.partial.bind(this);
this.push = this.push.bind(this);