@sumaris-net/ngx-components 2.4.23-rc5 → 2.4.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19697,7 +19697,7 @@ class CustomReuseStrategy extends IonicRouteStrategy {
19697
19697
  shouldReuseRoute(future, curr) {
19698
19698
  const reuse = super.shouldReuseRoute(future, curr);
19699
19699
  // Is sam route config
19700
- if (future.routeConfig && future.routeConfig === curr.routeConfig) {
19700
+ if (!reuse && future.routeConfig && future.routeConfig === curr.routeConfig) {
19701
19701
  // Read the parameter name, where id is stored
19702
19702
  const pathIdParam = future.routeConfig.data && future.routeConfig.data.pathIdParam || 'id';
19703
19703
  // Read the current route id
@@ -19710,17 +19710,12 @@ class CustomReuseStrategy extends IonicRouteStrategy {
19710
19710
  : future.params[pathIdParam]; // e.g. path like '/<ID>'
19711
19711
  // Reuse if same ID, using a futureId, if exists
19712
19712
  if (isNotNil(futureId)) {
19713
- if (!reuse) {
19714
- // Allow reuse when changing from /new to /new?id=:id
19715
- if (currId === 'new' && isNil(curr.queryParams[pathIdParam]) && future.params[pathIdParam] === 'new' && isNotNil(future.queryParams[pathIdParam])) {
19716
- return true;
19717
- }
19718
- // Allow reuse same id, expect when expected '/new'
19719
- return futureId !== 'new' && futureId === currId;
19720
- }
19721
- else {
19722
- console.log(`Router reuse={reuse} from /${curr.params[pathIdParam]} to /${future.params[pathIdParam]}`);
19713
+ // Allow reuse when changing from /new to /new?id=:id
19714
+ if (currId === 'new' && isNil(curr.queryParams[pathIdParam]) && future.params[pathIdParam] === 'new' && isNotNil(future.queryParams[pathIdParam])) {
19715
+ return true;
19723
19716
  }
19717
+ // Allow reuse same id, expect when expected '/new'
19718
+ return futureId !== 'new' && futureId === currId;
19724
19719
  }
19725
19720
  }
19726
19721
  return reuse;