Skip to content

Fix: disable Publish button after click to prevent double submissions#420

Merged
tkuhn merged 1 commit intomasterfrom
fix/prevent-double-publish
Mar 31, 2026
Merged

Fix: disable Publish button after click to prevent double submissions#420
tkuhn merged 1 commit intomasterfrom
fix/prevent-double-publish

Conversation

@tkuhn
Copy link
Copy Markdown
Contributor

@tkuhn tkuhn commented Mar 31, 2026

Summary

  • Disable the Publish button immediately on click and change its label to "Publishing…" to prevent duplicate submissions
  • Applied to both PublishForm.html (main publish flow) and PreviewPage.html (preview publish flow)

Root cause

PublishNanopub.publish() is a blocking network call. While the server is busy publishing, the browser shows no feedback — the button stays clickable. Users click again, causing a second form POST that publishes the same nanopub again.

Test plan

  • Click Publish — button should disable and show "Publishing…"
  • Verify the nanopub is published exactly once
  • If publishing fails (server error), reload the page and verify the button is active again

Closes #419

🤖 Generated with Claude Code

The Publish button had no protection against multiple clicks. Since
PublishNanopub.publish() is a blocking network call, users would click
again while waiting, causing the same nanopub to be published multiple
times. The button now disables itself and shows "Publishing…" on first
click.

Closes #419

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tkuhn tkuhn merged commit 74a0818 into master Mar 31, 2026
8 checks passed
@tkuhn tkuhn deleted the fix/prevent-double-publish branch March 31, 2026 06:46
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

🎉 This PR is included in version 4.23.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Publishing is sometimes slow and no double-click protection

1 participant