Browse Source

fix(core): update flattedRoutes when patchRoute action dispatched

pull/2425/head
mehmet-erim 6 years ago
parent
commit
15a82794ac
  1. 14
      npm/ng-packs/packages/core/src/lib/states/config.state.ts

14
npm/ng-packs/packages/core/src/lib/states/config.state.ts

@ -246,10 +246,20 @@ export class ConfigState {
) {
let routes: ABP.FullRoute[] = getState().routes;
const index = routes.findIndex(route => route.name === name);
routes = patchRouteDeep(routes, name, newValue);
const flattedRoutes = getState().flattedRoutes;
const index = flattedRoutes.findIndex(route => route.name === name);
if (index > -1) {
flattedRoutes[index] = newValue as ABP.FullRoute;
}
return patchState({
routes,
flattedRoutes,
});
}
return patchState({
routes,
});

Loading…
Cancel
Save