update conditions for sidebar toggle