Jake Vanderwerf
2025-11-04 42fa8304ddb811b0f725f245130f70c0f5e86a6c
assets/js/concise/UploadManager.js
@@ -38,6 +38,8 @@
         ],
      });
      window.jvbUploadBlobs = this.uploadStore;
      // Subscribe to store events
      this.fieldStore.subscribe(this.handleFieldStoreEvent.bind(this));
      this.uploadStore.subscribe(this.handleUploadStoreEvent.bind(this));
@@ -48,7 +50,6 @@
      // Core data structures
      this.fields = new Map();
      this.uploads = new Map();
      this.uploadBlobs = new Map();
      this.groups = new Map();
      this.selected = new Map();
      this.selectionHandlers = new Map();
@@ -1750,6 +1751,9 @@
      formData.append('posts', JSON.stringify(posts));
      formData.append('upload_ids', JSON.stringify(uploadMap));
      for (const [key, value] of formData.entries()) {
         console.log(key, value);
      }
      const operation = {
         endpoint: 'uploads/groups',
         method: 'POST',
@@ -2861,11 +2865,14 @@
      }
   }
   async saveUpload(upload) {
      // Handle blob data separately
      if (upload.file instanceof File || upload.file instanceof Blob) {
         await this.uploadStore.saveBlob(upload.id, upload.file);
         // Don't store the file in the main store
         const { file, originalFile, ...cleanUpload } = upload;
      // Use the processed file if available, otherwise original
      const fileToStore = upload.processedFile || upload.originalFile || upload.file;
      if (fileToStore instanceof File || fileToStore instanceof Blob) {
         await this.uploadStore.saveBlob(upload.id, fileToStore);
         // Don't store file objects in main store
         const { file, originalFile, processedFile, ...cleanUpload } = upload;
         await this.uploadStore.save(cleanUpload);
      } else {
         await this.uploadStore.save(upload);