Skip to content

Commit 737641a

Browse files
committed
Refresh search popular products in incremental syncs
1 parent 5ccab86 commit 737641a

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

Modules/Sources/PointOfSale/Models/PointOfSaleAggregateModel.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,8 +715,17 @@ private extension PointOfSaleAggregateModel {
715715

716716
private func performIncrementalSync() {
717717
guard let catalogSyncCoordinator else { return }
718+
let popularPurchasableItemsController = popularPurchasableItemsController
719+
let siteID = siteID
718720
Task {
719-
try? await catalogSyncCoordinator.performIncrementalSync(for: siteID)
721+
await withTaskGroup(of: Void.self) { group in
722+
group.addTask {
723+
try? await catalogSyncCoordinator.performIncrementalSync(for: siteID)
724+
}
725+
group.addTask {
726+
await popularPurchasableItemsController.refreshItems(base: .root)
727+
}
728+
}
720729
}
721730
}
722731

Modules/Sources/PointOfSale/Presentation/ItemListView.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,14 @@ struct ItemListView: View {
181181
)
182182
.refreshable {
183183
analyticsTracker.trackRefresh()
184-
await itemsController(itemListType).refreshItems(base: .root)
184+
await withTaskGroup(of: Void.self) { group in
185+
group.addTask {
186+
await itemsController(itemListType).refreshItems(base: .root)
187+
}
188+
group.addTask {
189+
await posModel.popularPurchasableItemsController.refreshItems(base: .root)
190+
}
191+
}
185192
}
186193
}
187194
.task {

0 commit comments

Comments
 (0)