I am new to javascript and am adapting a codebase, I have two conditions within my spin function, one says that you can ONLY spin the wheel once and the other says that you may not spin the wheel with an empty email field.
An unintended consequence (its not a bug because the conditions are doing exactly what they are asked) is that if you don’t enter an email and “click” the spin button your still engaging the “only spin once” condition.
I need to create a condition that a spin (.click) isnt valid unless the email address is created, i am not sure how to do this, here is my relevant code snippet:
/*WHEEL SPIN FUNCTION*/
$('#spin').one('click', function(){
if ($("#login").val() === "") {
return;
}