[ui] simplify a logic expression