In other words, `a || b ? c : d` means `(a || b) ? c : d`, and I think you mean `a || (b ? c : d)`.