@sumaris-net/ngx-components 2.4.23-rc4 → 2.4.23-rc5
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.
- package/esm2020/src/app/shared/shared-routing.module.mjs +14 -9
- package/fesm2015/sumaris-net.ngx-components.mjs +13 -8
- package/fesm2015/sumaris-net.ngx-components.mjs.map +1 -1
- package/fesm2020/sumaris-net.ngx-components.mjs +13 -8
- package/fesm2020/sumaris-net.ngx-components.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -19695,9 +19695,9 @@ class CustomReuseStrategy extends IonicRouteStrategy {
|
|
|
19695
19695
|
* @param curr
|
|
19696
19696
|
*/
|
|
19697
19697
|
shouldReuseRoute(future, curr) {
|
|
19698
|
-
const
|
|
19698
|
+
const reuse = super.shouldReuseRoute(future, curr);
|
|
19699
19699
|
// Is sam route config
|
|
19700
|
-
if (
|
|
19700
|
+
if (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,15 +19710,20 @@ 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
|
-
|
|
19714
|
-
|
|
19715
|
-
|
|
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]}`);
|
|
19716
19723
|
}
|
|
19717
|
-
// Allow reuse same id, expect when expected '/new'
|
|
19718
|
-
return futureId !== 'new' && futureId === currId;
|
|
19719
19724
|
}
|
|
19720
19725
|
}
|
|
19721
|
-
return
|
|
19726
|
+
return reuse;
|
|
19722
19727
|
}
|
|
19723
19728
|
}
|
|
19724
19729
|
CustomReuseStrategy.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CustomReuseStrategy, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|