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