@wavemaker/app-ng-runtime 11.5.3-next.1417092 → 11.5.3-next.1417093

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.
@@ -1308,6 +1308,7 @@ class BasePageComponent extends FragmentMonitor {
1308
1308
  this.onPageContentReady = () => {
1309
1309
  this.fragmentsLoaded$.subscribe(noop$1, noop$1, () => {
1310
1310
  this.invokeOnReady();
1311
+ this.handlePageThumbnails();
1311
1312
  });
1312
1313
  unMuteWatchers();
1313
1314
  this.viewInit$.complete();
@@ -1318,29 +1319,24 @@ class BasePageComponent extends FragmentMonitor {
1318
1319
  });
1319
1320
  }
1320
1321
  ngOnDestroy() {
1321
- this.handlePageDestroy().then(() => {
1322
- this.savePageSnapShot();
1323
- this.destroy$.complete();
1324
- });
1322
+ this.savePageSnapShot();
1323
+ this.destroy$.complete();
1325
1324
  }
1326
- async handlePageDestroy() {
1325
+ handlePageThumbnails() {
1327
1326
  let captureAppThumbnail = this.canCaptureApplicationThumbnail() ?? false;
1328
- if (captureAppThumbnail || true) {
1329
- await this.emitRunTimePageDestroyEvent();
1327
+ if (captureAppThumbnail) {
1328
+ setTimeout(() => {
1329
+ this.emitRunTimeAppThumbnailCaptureEvent();
1330
+ }, 2000);
1330
1331
  }
1331
1332
  }
1332
1333
  canCaptureApplicationThumbnail() {
1333
- //Conditions to capture only home pages and emit event in development mode.
1334
+ //Conditions to capture only home pages.
1334
1335
  return (localStorage.getItem("captureApplicationThumbnail") === 'true' && this?.App?.landingPageName === this?.pageName && window?.top?.html2canvas && !this.App.isAppThumbnailCaptured) ?? false;
1335
1336
  }
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
- });
1337
+ emitRunTimeAppThumbnailCaptureEvent() {
1338
+ window.top.postMessage({ key: 'capture-app-thumbnail' }, "*");
1339
+ this.App.isAppThumbnailCaptured = true;
1344
1340
  }
1345
1341
  onReady() { }
1346
1342
  onBeforePageReady() { }