-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug, Web, UI] Double New Data Record on Double-Click #1292
Comments
This looks like an async error. |
Dylan, and I saw a similar problem when changing this before. |
In C++ you could use RAII to solve this but I don't think that works in JavaScript. Can you create a flag, that indicates that the button has already been pressed so that it won't make the call twice? i.e. var isSubmitting = false;
:
function callback(ok, reply) {
isSubmitting = false;
if (ok) {
if ((a_data && !a_data.external) || (!a_data && !extern.prop("checked"))) {
// Start transfer if source changed
var tmp
:
// The following are in the options var
:
:
buttons: [
{
text: "Cancel",
click: function () {
$(this).dialog("close");
},
},
{
id: "do_it",
text: DLG_DATA_BTN_LABEL[a_mode],
click: function () {
if (isSubmitting) return;
isSubmitting = true;
:
:
close: function (ev, ui) {
isSubmitting = false;
jsoned.destroy();
$(this).dialog("destroy").remove();
},
|
I don't think this error you found is related to dual entries.
This is simply because there is no text in the source_file entry in the form. At least that is my first impression. |
Description
This bug occurs when the
Start
button on creating a new data record is left-clicked quickly in succession before the modal closes. This leads to 2 data records being created.Steps to Replicate
Start
buttonArtifacts
Bug Replication
Screen.Recording.2025-02-05.at.4.20.54.PM.mov
Bug Console Log
Bug Error Stack Trace
The text was updated successfully, but these errors were encountered: