Impossible to set "if" and "else" conditions when changing the state

impossible to set “if” and “else” conditions when changing the state