@adriansteffan/reactive 0.2.4 → 0.2.5
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/{mod-Cx6xH-XQ.js → mod-CHZCELgX.js} +3113 -3109
- package/dist/reactive.es.js +1 -1
- package/dist/reactive.umd.js +615 -615
- package/dist/{web-DQBLwBB7.js → web-BNJX4siP.js} +1 -1
- package/dist/{web-BTzxclIT.js → web-DabPva5b.js} +1 -1
- package/package.json +1 -1
- package/src/components/upload.tsx +7 -2
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
Store,
|
|
13
13
|
TrialData,
|
|
14
14
|
} from '../utils/common';
|
|
15
|
-
import { BlobWriter, TextReader, ZipWriter } from '@zip.js/zip.js';
|
|
15
|
+
import { BlobReader, BlobWriter, TextReader, ZipWriter } from '@zip.js/zip.js';
|
|
16
16
|
import { Filesystem, Directory, Encoding } from '@capacitor/filesystem';
|
|
17
17
|
import { buildUploadFiles, convertArrayOfObjectsToCSV } from '../utils/upload';
|
|
18
18
|
import { registerSimulation, getBackendUrl, getInitialParticipant } from '../utils/simulation';
|
|
@@ -283,7 +283,12 @@ export default function Upload({
|
|
|
283
283
|
const zipWriter = new ZipWriter(new BlobWriter());
|
|
284
284
|
|
|
285
285
|
for (const file of files) {
|
|
286
|
-
|
|
286
|
+
if (file.encoding === 'base64') {
|
|
287
|
+
const binary = Uint8Array.from(atob(file.content), (c) => c.charCodeAt(0));
|
|
288
|
+
await zipWriter.add(file.filename, new BlobReader(new Blob([binary])));
|
|
289
|
+
} else {
|
|
290
|
+
await zipWriter.add(file.filename, new TextReader(file.content));
|
|
291
|
+
}
|
|
287
292
|
}
|
|
288
293
|
|
|
289
294
|
const blob = await zipWriter.close();
|