On the login modal, when a user clicks “log in” I set a custom state for logging-in = yes, and have the button conditionally show the words “logging in…” with a spinning cog as a loading icon on the left. This is a good feedback mechanism to let the user know we’re logging them in (since it takes a few seconds).
However, when the user types in, say, the wrong password, they get an error message. It does not, however, change my custom state back to “no” so the but still saying “logging in…”. This can confuse users.
Is there any way for me to set this condition back to “no” if the user types in the wrong password? …and, still have the bubble error message appear so the user knows it was their password that was the problem.
Example: