mirror of
https://github.com/PrivateCaptcha/PrivateCaptcha.git
synced 2026-02-08 14:59:25 -06:00
Skip duplicate user started and execute triggers
This commit is contained in:
@@ -358,6 +358,11 @@ export class CaptchaWidget {
|
||||
* @returns {Promise<never>} promise intentionally does not resolve so that the form can be submitted via the callbacks
|
||||
*/
|
||||
execute() {
|
||||
if (this._apiTriggered && (STATE_ERROR !== this._state)) {
|
||||
this.trace(`skipping duplicate execute event handler`);
|
||||
return new Promise(() => { });
|
||||
}
|
||||
|
||||
this.trace(`execute event handler. state=${this._state}`);
|
||||
this._apiTriggered = true;
|
||||
|
||||
@@ -373,6 +378,11 @@ export class CaptchaWidget {
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
||||
if (this._userStarted && (STATE_ERROR !== this._state)) {
|
||||
this.trace('skipping duplicate onChecked handler')
|
||||
return;
|
||||
}
|
||||
|
||||
this.trace(`onChecked event handler. state=${this._state}`);
|
||||
this._userStarted = true;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/PrivateCaptcha/PrivateCaptcha.git"
|
||||
},
|
||||
"version": "0.0.16",
|
||||
"version": "0.0.17",
|
||||
"main": "index.js",
|
||||
"type": "module",
|
||||
"private": false,
|
||||
|
||||
Reference in New Issue
Block a user