@rdlabo/ionic-angular-kit 22.0.0-6 → 22.0.0-8
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/README.md +1 -0
- package/docs/offline-realtime.md +31 -0
- package/docs/optional-features.md +16 -0
- package/fesm2022/rdlabo-ionic-angular-kit-app-update.mjs +133 -4
- package/fesm2022/rdlabo-ionic-angular-kit-app-update.mjs.map +1 -1
- package/fesm2022/rdlabo-ionic-angular-kit-offline.mjs +26 -8
- package/fesm2022/rdlabo-ionic-angular-kit-offline.mjs.map +1 -1
- package/fesm2022/rdlabo-ionic-angular-kit.mjs +30 -5
- package/fesm2022/rdlabo-ionic-angular-kit.mjs.map +1 -1
- package/package.json +1 -1
- package/types/rdlabo-ionic-angular-kit-app-update.d.ts +11 -1
- package/types/rdlabo-ionic-angular-kit-offline.d.ts +17 -4
- package/types/rdlabo-ionic-angular-kit.d.ts +11 -0
|
@@ -1519,9 +1519,18 @@ const kitRequireAuthorizedGuard = (_route, state) => {
|
|
|
1519
1519
|
const router = inject(Router);
|
|
1520
1520
|
const navCtrl = inject(NavController);
|
|
1521
1521
|
const access = inject(KitAuthAccessService);
|
|
1522
|
+
const errorHandler = inject(ErrorHandler);
|
|
1522
1523
|
const lease = access.beginTransition({ suspendRemote: true });
|
|
1523
|
-
const
|
|
1524
|
-
|
|
1524
|
+
const reportError = (error) => {
|
|
1525
|
+
try {
|
|
1526
|
+
errorHandler.handleError(error);
|
|
1527
|
+
}
|
|
1528
|
+
catch {
|
|
1529
|
+
// Error reporting must not create an unhandled background rejection.
|
|
1530
|
+
}
|
|
1531
|
+
};
|
|
1532
|
+
const redirectUnauthorized = (currentLease = lease) => {
|
|
1533
|
+
if (!currentLease.isCurrent())
|
|
1525
1534
|
return false;
|
|
1526
1535
|
access.clear();
|
|
1527
1536
|
navCtrl.setDirection('root');
|
|
@@ -1559,17 +1568,33 @@ const kitRequireAuthorizedGuard = (_route, state) => {
|
|
|
1559
1568
|
if (!resumeLease.isCurrent())
|
|
1560
1569
|
return false;
|
|
1561
1570
|
const resume = async () => result.resume(resumeLease);
|
|
1562
|
-
|
|
1571
|
+
const handleResumeError = (error) => {
|
|
1563
1572
|
if (!resumeLease.isCurrent())
|
|
1564
1573
|
return;
|
|
1565
1574
|
if (isExplicitAuthDenial(error)) {
|
|
1575
|
+
if (result.resumeMode === 'background') {
|
|
1576
|
+
redirectUnauthorized(resumeLease);
|
|
1577
|
+
reportError(error);
|
|
1578
|
+
return;
|
|
1579
|
+
}
|
|
1566
1580
|
access.clear();
|
|
1567
1581
|
throw error;
|
|
1568
1582
|
}
|
|
1569
1583
|
if (!isUnavailableError?.(error))
|
|
1570
1584
|
throw error;
|
|
1571
|
-
|
|
1572
|
-
|
|
1585
|
+
};
|
|
1586
|
+
if (result.resumeMode === 'background') {
|
|
1587
|
+
void resume().catch((error) => {
|
|
1588
|
+
try {
|
|
1589
|
+
handleResumeError(error);
|
|
1590
|
+
}
|
|
1591
|
+
catch (unhandledError) {
|
|
1592
|
+
reportError(unhandledError);
|
|
1593
|
+
}
|
|
1594
|
+
});
|
|
1595
|
+
return resumeLease.isCurrent();
|
|
1596
|
+
}
|
|
1597
|
+
await resume().catch(handleResumeError);
|
|
1573
1598
|
return resumeLease.isCurrent();
|
|
1574
1599
|
}
|
|
1575
1600
|
if (result === true)
|