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.
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.
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.