@wavemaker/app-ng-runtime 11.5.1-rc.5402 → 11.5.1-rc.5413

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.
@@ -1318,9 +1318,34 @@ class BasePageComponent extends FragmentMonitor {
1318
1318
  });
1319
1319
  }
1320
1320
  ngOnDestroy() {
1321
+ //this.captureApplicationThumbnail();
1321
1322
  this.savePageSnapShot();
1322
1323
  this.destroy$.complete();
1323
1324
  }
1325
+ captureApplicationThumbnail() {
1326
+ const root = this;
1327
+ let captureApplicationThumbnail = localStorage.getItem("captureApplicationThumbnail") === "true" ? true : false;
1328
+ if (captureApplicationThumbnail && this.App.landingPageName === this.pageName && !this.App.isApplicationThumbnailCaptured) {
1329
+ html2canvas(document.body)
1330
+ .then(canvas => {
1331
+ try {
1332
+ root.App.isApplicationThumbnailCaptured = true;
1333
+ const screenshotUrl = canvas.toDataURL("image/png");
1334
+ console.log(screenshotUrl);
1335
+ const a = document.createElement("a");
1336
+ a.href = screenshotUrl;
1337
+ a.download = "screenshot.jpg";
1338
+ a.click();
1339
+ }
1340
+ catch (error) {
1341
+ console.error('Error in html2canvas then block:', error);
1342
+ }
1343
+ })
1344
+ .catch(error => {
1345
+ console.error('Error in html2canvas promise:', error);
1346
+ });
1347
+ }
1348
+ }
1324
1349
  onReady() { }
1325
1350
  onBeforePageReady() { }
1326
1351
  onBeforePageLeave() { }