From 959bdce13f57b78bf71edce5dfab2462b547a817 Mon Sep 17 00:00:00 2001 From: "Hedden, Kyle Matthew" Date: Mon, 11 Mar 2024 10:45:55 -0400 Subject: [PATCH] Code review. Include the only 1 element condition to the carousel pager logic. --- MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift b/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift index 0328e1ff..5dd4612b 100644 --- a/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift +++ b/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift @@ -143,7 +143,7 @@ open class Carousel: View { // Check must be dispatched to main for the layout to complete in layoutCollection. DispatchQueue.main.async { [self] in - let shouldHidePager = molecules?.isEmpty ?? true || collectionView.contentSize.width < bounds.width + let shouldHidePager = molecules?.count ?? 0 < 2 || collectionView.contentSize.width < bounds.width if let pagingView = pagingView, shouldHidePager != pagingView.isHidden { pagingView.isHidden = shouldHidePager pagingBottomPin?.isActive = !shouldHidePager