@wavemaker/app-ng-runtime 11.5.3-next.1417091 → 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();
@@ -1321,6 +1322,22 @@ class BasePageComponent extends FragmentMonitor {
1321
1322
  this.savePageSnapShot();
1322
1323
  this.destroy$.complete();
1323
1324
  }
1325
+ handlePageThumbnails() {
1326
+ let captureAppThumbnail = this.canCaptureApplicationThumbnail() ?? false;
1327
+ if (captureAppThumbnail) {
1328
+ setTimeout(() => {
1329
+ this.emitRunTimeAppThumbnailCaptureEvent();
1330
+ }, 2000);
1331
+ }
1332
+ }
1333
+ canCaptureApplicationThumbnail() {
1334
+ //Conditions to capture only home pages.
1335
+ return (localStorage.getItem("captureApplicationThumbnail") === 'true' && this?.App?.landingPageName === this?.pageName && window?.top?.html2canvas && !this.App.isAppThumbnailCaptured) ?? false;
1336
+ }
1337
+ emitRunTimeAppThumbnailCaptureEvent() {
1338
+ window.top.postMessage({ key: 'capture-app-thumbnail' }, "*");
1339
+ this.App.isAppThumbnailCaptured = true;
1340
+ }
1324
1341
  onReady() { }
1325
1342
  onBeforePageReady() { }
1326
1343
  onBeforePageLeave() { }