@powerhousedao/reactor-browser 6.0.0-dev.246 → 6.0.0-dev.248

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.
package/dist/index.js CHANGED
@@ -119,7 +119,9 @@ function getDocumentTypeIcon(document) {
119
119
  }
120
120
  }
121
121
  async function downloadFile(document, fileName) {
122
- (await createZip(document)).generateAsync({ type: "blob" }).then((blob) => {
122
+ try {
123
+ const data = await createZip(document);
124
+ const blob = new Blob([new Uint8Array(data)], { type: "application/zip" });
123
125
  const link = window.document.createElement("a");
124
126
  link.style.display = "none";
125
127
  link.href = URL.createObjectURL(blob);
@@ -127,7 +129,9 @@ async function downloadFile(document, fileName) {
127
129
  window.document.body.appendChild(link);
128
130
  link.click();
129
131
  window.document.body.removeChild(link);
130
- }).catch(logger.error);
132
+ } catch (e) {
133
+ logger.error(e instanceof Error ? e.message : String(e));
134
+ }
131
135
  }
132
136
  async function getDocumentExtension(document) {
133
137
  const documentType = document.header.documentType;