From 8fc64daf7e18234717cac6c2736cb860e8ea8b97 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 10 Feb 2026 23:16:28 +0000
Subject: [PATCH] =UploadManager.js remove upload fix
---
assets/js/concise/UploadManager.js | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/assets/js/concise/UploadManager.js b/assets/js/concise/UploadManager.js
index 61682ec..a18ff2d 100644
--- a/assets/js/concise/UploadManager.js
+++ b/assets/js/concise/UploadManager.js
@@ -1465,8 +1465,24 @@
if (!item) return;
const uploadId = item.dataset.uploadId;
+ const attachmentId = item.dataset.id;
+
+ if (!uploadId && !attachmentId) return;
if (!confirm('Remove this item?')) return;
- await this.removeUpload(uploadId);
+
+ if (uploadId) {
+ // New upload managed by stores
+ await this.removeUpload(uploadId);
+ } else {
+ // Existing server-rendered attachment
+ const fieldId = this.getFieldIdFromElement(button);
+ item.remove();
+ if (fieldId) {
+ this.maybeLockUploads(fieldId);
+ this.notify('attachment-removed', { attachmentId, fieldId });
+ }
+ }
+
this.a11y.announce('Item removed');
}
--
Gitblit v1.10.0