Automattic / studio

Studio by WordPress.com, a free desktop app that helps developers streamline their local WordPress development workflow.
https://developer.wordpress.com/studio/
GNU General Public License v2.0
138 stars 12 forks source link

fix: Prevent resubmissions of pending site addition #246

Closed dcalhoun closed 1 week ago

dcalhoun commented 1 week ago

Proposed Changes

Disable the submit button when a site addition is pending.

Without disabling the submit button, one can resubmit the form which displays an unexpected error and/or results in duplicative site directories.

Testing Instructions

  1. Click "Add site."
  2. Click "Add site" within the modal.
  3. Quickly click "Adding site…"
  4. Verify an error is not displayed and the site addition succeeds.

https://github.com/Automattic/studio/assets/438664/b256743d-5ae9-4acd-b315-51eae474eba5

Pre-merge Checklist

wojtekn commented 1 week ago

Good catch! I experienced that when I was doing a user demo this week, and I thought it might be some random error. It seems that the user might have double-clicked the button.