@wavemaker/app-ng-runtime 11.5.2-rc.5436 → 11.5.3-next.1417092
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.
- app-ng-runtime/package.json +1 -1
- app-ng-runtime/runtime/base/bundles/index.umd.js +31 -6
- app-ng-runtime/runtime/base/components/base-page.component.d.ts +3 -0
- app-ng-runtime/runtime/base/esm2020/components/base-page.component.mjs +24 -3
- app-ng-runtime/runtime/base/fesm2015/index.mjs +28 -3
- app-ng-runtime/runtime/base/fesm2015/index.mjs.map +1 -1
- app-ng-runtime/runtime/base/fesm2020/index.mjs +23 -2
- app-ng-runtime/runtime/base/fesm2020/index.mjs.map +1 -1
|
@@ -1318,8 +1318,29 @@ class BasePageComponent extends FragmentMonitor {
|
|
|
1318
1318
|
});
|
|
1319
1319
|
}
|
|
1320
1320
|
ngOnDestroy() {
|
|
1321
|
-
this.
|
|
1322
|
-
|
|
1321
|
+
this.handlePageDestroy().then(() => {
|
|
1322
|
+
this.savePageSnapShot();
|
|
1323
|
+
this.destroy$.complete();
|
|
1324
|
+
});
|
|
1325
|
+
}
|
|
1326
|
+
async handlePageDestroy() {
|
|
1327
|
+
let captureAppThumbnail = this.canCaptureApplicationThumbnail() ?? false;
|
|
1328
|
+
if (captureAppThumbnail || true) {
|
|
1329
|
+
await this.emitRunTimePageDestroyEvent();
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
canCaptureApplicationThumbnail() {
|
|
1333
|
+
//Conditions to capture only home pages and emit event in development mode.
|
|
1334
|
+
return (localStorage.getItem("captureApplicationThumbnail") === 'true' && this?.App?.landingPageName === this?.pageName && window?.top?.html2canvas && !this.App.isAppThumbnailCaptured) ?? false;
|
|
1335
|
+
}
|
|
1336
|
+
emitRunTimePageDestroyEvent() {
|
|
1337
|
+
return new Promise((resolve) => {
|
|
1338
|
+
window.top.postMessage({ key: 'capture-app-thumbnail' }, "*");
|
|
1339
|
+
this.App.isAppThumbnailCaptured = true;
|
|
1340
|
+
setTimeout(() => {
|
|
1341
|
+
resolve();
|
|
1342
|
+
}, 3000);
|
|
1343
|
+
});
|
|
1323
1344
|
}
|
|
1324
1345
|
onReady() { }
|
|
1325
1346
|
onBeforePageReady() { }
|