fix holding enter spam

This commit is contained in:
ChrisLolz 2025-01-23 02:33:51 -05:00
parent 14614eb60a
commit f52e69bf2e
2 changed files with 60 additions and 56 deletions

View File

@ -142,6 +142,7 @@ export default class LoginFormUiHandler extends FormModalUiHandler {
this.processExternalProvider(config); this.processExternalProvider(config);
const originalLoginAction = this.submitAction; const originalLoginAction = this.submitAction;
this.submitAction = (_) => { this.submitAction = (_) => {
if (globalScene.tweens.getTweensOf(this.modalContainer).length === 0) {
// Prevent overlapping overrides on action modification // Prevent overlapping overrides on action modification
this.submitAction = originalLoginAction; this.submitAction = originalLoginAction;
this.sanitizeInputs(); this.sanitizeInputs();
@ -163,6 +164,7 @@ export default class LoginFormUiHandler extends FormModalUiHandler {
onFail(error); onFail(error);
} }
}); });
}
}; };
return true; return true;

View File

@ -91,6 +91,7 @@ export default class RegistrationFormUiHandler extends FormModalUiHandler {
const originalRegistrationAction = this.submitAction; const originalRegistrationAction = this.submitAction;
this.submitAction = (_) => { this.submitAction = (_) => {
if (globalScene.tweens.getTweensOf(this.modalContainer).length === 0) {
// Prevent overlapping overrides on action modification // Prevent overlapping overrides on action modification
this.submitAction = originalRegistrationAction; this.submitAction = originalRegistrationAction;
this.sanitizeInputs(); this.sanitizeInputs();
@ -128,6 +129,7 @@ export default class RegistrationFormUiHandler extends FormModalUiHandler {
onFail(registerError); onFail(registerError);
} }
}); });
}
}; };
return true; return true;