Skip to content

Commit 3b334d0

Browse files
committed
Make var non-optional
1 parent e378163 commit 3b334d0

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

WooCommerce/Classes/POS/Presentation/ItemListView.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,8 @@ private extension ItemListView {
130130
ItemCardView(item: item)
131131
})
132132
}
133-
if let shouldShowGhostableItemCard = viewModel.shouldShowGhostableItemCard {
134-
GhostItemCardView()
135-
.renderedIf(shouldShowGhostableItemCard && viewModel.state == .loading)
136-
}
133+
GhostItemCardView()
134+
.renderedIf(viewModel.shouldShowGhostableItemCard && viewModel.state == .loading)
137135
}
138136
.padding(.bottom, floatingControlAreaSize.height)
139137
.padding(.horizontal, Constants.itemListPadding)

WooCommerce/Classes/POS/ViewModels/ItemListViewModel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ final class ItemListViewModel: ItemListViewModelProtocol {
1212

1313
@Published private var currentPage: Int = Constants.initialPage
1414

15-
private(set) var shouldShowGhostableItemCard: Bool?
15+
private(set) var shouldShowGhostableItemCard: Bool = false
1616

1717
var shouldShowHeaderBanner: Bool {
1818
// The banner it's shown as long as it hasn't already been dismissed once:
@@ -30,7 +30,7 @@ final class ItemListViewModel: ItemListViewModelProtocol {
3030
var itemsPublisher: Published<[POSItem]>.Publisher { $items }
3131
var statePublisher: Published<ItemListViewModel.ItemListState>.Publisher { $state }
3232

33-
init(itemProvider: POSItemProvider, shouldShowGhostableItemCard: Bool? = false) {
33+
init(itemProvider: POSItemProvider, shouldShowGhostableItemCard: Bool = false) {
3434
self.itemProvider = itemProvider
3535
self.shouldShowGhostableItemCard = shouldShowGhostableItemCard
3636
selectedItemPublisher = selectedItemSubject.eraseToAnyPublisher()

0 commit comments

Comments
 (0)