Prevent double-submit on admin forms
Disables submit buttons after first click to prevent race conditions that could corrupt card data via concurrent writes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -93,6 +93,16 @@ export function renderAdmin(cards: BoardCard[], options: { storageMode: string;
|
|||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
|
<script>
|
||||||
|
document.querySelectorAll("form").forEach(f => {
|
||||||
|
f.addEventListener("submit", () => {
|
||||||
|
f.querySelectorAll("button[type=submit]").forEach(b => {
|
||||||
|
b.disabled = true;
|
||||||
|
b.textContent = "Wait...";
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
`
|
`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user