@@ -141,11 +141,9 @@ private extension ProductStore {
141141 excludedProductIDs: excludedProductIDs) { [ weak self] result in
142142 switch result {
143143 case . success( let products) :
144- let shouldDeleteExistingProducts = pageNumber == Default . firstPageNumber
145144 self ? . upsertSearchResultsInBackground ( siteID: siteID,
146145 keyword: keyword,
147- readOnlyProducts: products,
148- shouldDeleteExistingProducts: shouldDeleteExistingProducts) {
146+ readOnlyProducts: products) {
149147 onCompletion ( . success( ( ) ) )
150148 }
151149 case . failure( let error) :
@@ -673,13 +671,9 @@ private extension ProductStore {
673671 private func upsertSearchResultsInBackground( siteID: Int64 ,
674672 keyword: String ,
675673 readOnlyProducts: [ Networking . Product ] ,
676- shouldDeleteExistingProducts: Bool = false ,
677674 onCompletion: @escaping ( ) -> Void ) {
678675 let derivedStorage = sharedDerivedStorage
679676 derivedStorage. perform { [ weak self] in
680- if shouldDeleteExistingProducts {
681- derivedStorage. deleteProducts ( siteID: siteID)
682- }
683677 self ? . upsertStoredProducts ( readOnlyProducts: readOnlyProducts, in: derivedStorage)
684678 self ? . upsertStoredResults ( siteID: siteID, keyword: keyword, readOnlyProducts: readOnlyProducts, in: derivedStorage)
685679 }
0 commit comments