@hitsoft/e-donusum 1.0.73 → 1.0.74

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.
@@ -9309,15 +9309,14 @@ class HitSharedService {
9309
9309
  constructor() {
9310
9310
  this.apiName = 'eDonusum';
9311
9311
  this.previewFile = (base64) => {
9312
- const byteCharacters = atob(base64);
9313
- const byteNumbers = new Array(byteCharacters.length);
9314
- for (let i = 0; i < byteCharacters.length; i++) {
9315
- byteNumbers[i] = byteCharacters.charCodeAt(i);
9316
- }
9317
- const byteArray = new Uint8Array(byteNumbers);
9318
- const blob = new Blob([byteArray], { type: 'application/pdf' });
9312
+ const cleanBase64 = base64.includes(',') ? base64.split(',')[1] : base64;
9313
+ const bytes = Uint8Array.from(atob(cleanBase64), c => c.charCodeAt(0));
9314
+ const blob = new Blob([bytes], { type: 'application/pdf' });
9319
9315
  const url = URL.createObjectURL(blob);
9320
- window.open(url);
9316
+ // Yeni tab (preview)
9317
+ window.open(url, '_blank', 'noopener');
9318
+ // İstersen kısa süre sonra URL'i serbest bırak (preview açıldıktan sonra)
9319
+ setTimeout(() => URL.revokeObjectURL(url), 60000);
9321
9320
  };
9322
9321
  }
9323
9322
  }