Skip to content

Commit

Permalink
fix(router): await viewModel configureRouter
Browse files Browse the repository at this point in the history
  • Loading branch information
bigopon committed May 3, 2019
1 parent ca31bf6 commit aed5f53
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/app-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { EventAggregator } from 'aurelia-event-aggregator';
import { NavigationInstruction } from './navigation-instruction';
import { ViewPort, ConfiguresRouter, PipelineResult } from './interfaces';
import { RouterEvent } from './router-event';
import { RouterConfiguration } from './router-configuration';

/**@internal */
declare module 'aurelia-dependency-injection' {
Expand Down Expand Up @@ -96,10 +97,13 @@ export class AppRouter extends Router {
const resolveConfiguredPromise = this._resolveConfiguredPromise;
this._resolveConfiguredPromise = () => {/**/};
return this
.configure(config => {
viewModel.configureRouter(config, this);
return config;
})
.configure(config =>
Promise
.resolve(viewModel.configureRouter(config, this))
// an issue with configure interface. Should be fixed there
// todo: fix this via configure interface in router
.then(() => config) as any
)
.then(() => {
this.activate();
resolveConfiguredPromise();
Expand Down

0 comments on commit aed5f53

Please sign in to comment.