From 0e4b986e81f8132a44e61fa8df18860301cc3468 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Thu, 01 Jan 2026 20:31:10 +0000
Subject: [PATCH] =JakeVan preliminary additions
---
assets/js/concise/Queue.js | 25 ++++++++++++++++++-------
1 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/assets/js/concise/Queue.js b/assets/js/concise/Queue.js
index d0fb19b..7e3033c 100644
--- a/assets/js/concise/Queue.js
+++ b/assets/js/concise/Queue.js
@@ -163,6 +163,7 @@
method: 'POST',
headers: {},
data: {},
+ sendNow: false, // true = process immediately
canMerge: true,
popup: 'Saving changes...',
title: 'Operation',
@@ -183,6 +184,14 @@
return null;
}
+ if (item.sendNow) {
+ this.processOperation(item).then(()=> {});
+ this.store.clearCache();
+ window.debouncer.schedule('fastQueue', this.startPolling.bind(this), 200);
+ this.showQueue();
+ return item.id;
+ }
+
const existingOps = Array.from(this.store.data.values()).filter(op=>
op.status === 'queued' &&
op.endpoint === item.endpoint &&
@@ -201,7 +210,6 @@
return existing.id;
}
- console.log('Added to Queue: ', item);
this.store.clearCache();
//Add new operation to DataStore
@@ -313,12 +321,14 @@
this.maybeStartPolling() ? this.showQueue() : this.hideQueue();
}
- async processOperation(operation) {
+ async processOperation(operation, skip = false) {
try {
- this.updateOperationStatus(operation.id, 'uploading');
+ if (!skip) {
+ this.updateOperationStatus(operation.id, 'uploading');
- if (operation.data?._isFormData) {
- operation.data = await this.store.objectToFormData(operation.data);
+ if (operation.data?._isFormData) {
+ operation.data = await this.store.objectToFormData(operation.data);
+ }
}
const url = `${this.config.apiBase}${operation.endpoint}`;
@@ -336,7 +346,6 @@
});
operation.headers['Content-Type'] = 'application/json';
}
-
const response = await fetch(url, {
method: operation.method,
headers: operation.headers,
@@ -344,7 +353,9 @@
});
const result = await response.json();
-
+ if (skip) {
+ operation.data = {};
+ }
if (response.ok && result.success !== false) {
// Handle server-side merge
if (result.id && operation.id !== result.id) {
--
Gitblit v1.10.0