fix: do not animate non-existing captcha modal#1869
Merged
KernelDeimos merged 3 commits intomainfrom Oct 30, 2025
Merged
Conversation
Calling `.fadeOut()` on the result of a jquery selector (i.e. the
evaluation of `$('.some-element-class')`, when it returns an object with
`length=0`) is a NOOP. That's right, it doesn't throw an error; it just
does nothing. This was preventing a temporary user from being created
when `.captcha-modal` isn't present because [the code intended to execute
after the animation] was never run. (square brackets for clarity because
the English is inherently ambiguous)
Apparently the callback operand of $.fn.fadeOut may be called more than once if there are multiple matching elements. Although we expect there to only be one element matching the selector `".captcha-modal"`, someone editing the CSS and HTML would not expect such consequences to the logic of captcha.
This commit reduces the indentation level and complex arithmetic inside the createTempUser function in initgui. It is suspected that this change should greatly reduce measures of the "cognitive complexity" metric.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Calling
.fadeOut()on the result of a jquery selector (i.e. the evaluation of$('.some-element-class'), when it returns an object withlength=0) is a NOOP. That's right, it doesn't throw an error; it just does nothing. This was preventing a temporary user from being created when.captcha-modalisn't present because [the code intended to execute after the animation] was never run. (square brackets for clarity because the English is inherently ambiguous)