grasshopper-cms / grasshopper-cms

The one npm to use when integrating with Grasshopper.
http://grasshopper-docs.soliddigital.com
MIT License
4 stars 3 forks source link

When creating a new piece of content in admin, double-clicking on save button sometimes creates duplicate content #59

Open lukechinworth opened 6 years ago

lukechinworth commented 6 years ago

Currently, the save button sends an xhr request on every single click. The button changes to a spinner when the request is pending, indicating it is inactive, but it is still active; every click sends a request even when the button is displayed as a spinner.

The side effect of this is that duplicate content is sometimes created.

This click handler should return early if a save request is currently pending, rather than sending another request.

ericasummers commented 6 years ago

It looks like this is possibly happening on clicking the "Save" button when editing already existing content also. Duplicate content may be created at that time also.