Skip to content

Commit 2f73a6d

Browse files
committed
restore isLoading prop for manualCatalogUpdate button
1 parent 7d39c57 commit 2f73a6d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Modules/Sources/PointOfSale/Presentation/Settings/POSInformationCard.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,24 @@ struct POSInformationCardFieldRow: View {
3434
let buttonTitle: String?
3535
let buttonAction: (() -> Void)?
3636
let buttonStyle: ButtonStyle
37+
let isLoading: Bool
3738

3839
init(label: String,
3940
value: String,
4041
showSeparator: Bool = true,
4142
labelStyle: LabelStyle = .regular,
4243
buttonTitle: String? = nil,
4344
buttonAction: (() -> Void)? = nil,
44-
buttonStyle: ButtonStyle = .default) {
45+
buttonStyle: ButtonStyle = .default,
46+
isLoading: Bool = false) {
4547
self.label = label
4648
self.value = value
4749
self.showSeparator = showSeparator
4850
self.labelStyle = labelStyle
4951
self.buttonTitle = buttonTitle
5052
self.buttonAction = buttonAction
5153
self.buttonStyle = buttonStyle
54+
self.isLoading = isLoading
5255
}
5356

5457
var body: some View {
@@ -68,7 +71,8 @@ struct POSInformationCardFieldRow: View {
6871
Button(buttonTitle, action: buttonAction)
6972
.buttonStyle(POSInfoCardButtonStyle(
7073
size: .compact,
71-
variant: buttonStyle == .primary ? .primary : .default
74+
variant: buttonStyle == .primary ? .primary : .default,
75+
isLoading: isLoading
7276
))
7377
}
7478
}

Modules/Sources/PointOfSale/Presentation/Settings/POSSettingsLocalCatalogDetailView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ private extension POSSettingsLocalCatalogDetailView {
8585
await viewModel.refreshCatalog()
8686
}
8787
},
88-
buttonStyle: .primary
88+
buttonStyle: .primary,
89+
isLoading: viewModel.isRefreshingCatalog
8990
)
9091
}
9192
}

0 commit comments

Comments
 (0)