From 42fa8304ddb811b0f725f245130f70c0f5e86a6c Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 04 Nov 2025 06:12:02 +0000
Subject: [PATCH] =Refactored LoginManager to be more extensible and configurable, as well as an AjaxRateLimiter

---
 assets/js/concise/UploadManager.js |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/assets/js/concise/UploadManager.js b/assets/js/concise/UploadManager.js
index 7144428..0fd8f6e 100644
--- a/assets/js/concise/UploadManager.js
+++ b/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);

--
Gitblit v1.10.0