Spaces:
Running on Zero
Running on Zero
fix: prevent concurrent turn submissions
Browse filesCo-authored-by: Codex <noreply@openai.com>
- static/app.js +2 -0
static/app.js
CHANGED
|
@@ -51,6 +51,7 @@ bootstrap().catch(handleBootstrapError);
|
|
| 51 |
|
| 52 |
form.addEventListener("submit", async (event) => {
|
| 53 |
event.preventDefault();
|
|
|
|
| 54 |
const message = input.value.trim();
|
| 55 |
if (!message) return;
|
| 56 |
await runTurn(message);
|
|
@@ -134,6 +135,7 @@ whitespaceEl.addEventListener("click", async (event) => {
|
|
| 134 |
});
|
| 135 |
|
| 136 |
async function runTurn(message) {
|
|
|
|
| 137 |
bumpSessionRevision();
|
| 138 |
setActiveTab("page");
|
| 139 |
input.value = "";
|
|
|
|
| 51 |
|
| 52 |
form.addEventListener("submit", async (event) => {
|
| 53 |
event.preventDefault();
|
| 54 |
+
if (sessionControlsLocked || submit.disabled || input.disabled) return;
|
| 55 |
const message = input.value.trim();
|
| 56 |
if (!message) return;
|
| 57 |
await runTurn(message);
|
|
|
|
| 135 |
});
|
| 136 |
|
| 137 |
async function runTurn(message) {
|
| 138 |
+
if (sessionControlsLocked) return false;
|
| 139 |
bumpSessionRevision();
|
| 140 |
setActiveTab("page");
|
| 141 |
input.value = "";
|