`else if ((djs === 1 || djs > 2) && state.up) {`

(Or `else if (djs !== 0 && djs !== 2 && state.up) {`)