fix(core): update

This commit is contained in:
Philipp Kunz 2020-11-30 01:38:21 +00:00
parent 806e121144
commit f7e5af4113

View File

@ -80,11 +80,11 @@ export class SmartRouter {
*/
async _handleRouteState() {
const currentLocation = window.location.pathname;
const wantedRoute = this.routes.find((routeArg) => {
const wantedRoutes = this.routes.filter((routeArg) => {
return !!routeArg.matchFunction(currentLocation);
});
if (wantedRoute) {
for (const wantedRoute of wantedRoutes) {
const routeResult = wantedRoute.matchFunction(currentLocation);
await wantedRoute.handler(routeResult.valueOf() as IRouteInfo);
}