Refactor checking if an action sheet is visible