Skip to content

Commit

Permalink
Improved: Further optimzed - Threshold management(#2dmha76) code
Browse files Browse the repository at this point in the history
  • Loading branch information
shashwatbangar committed May 27, 2022
1 parent 966ca54 commit 6ab8de4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/store/modules/product/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,9 @@ const actions: ActionTree<ProductState, RootState> = {
totalVariant = state.products.total.variant
}
commit(types.PRODUCT_LIST_UPDATED, { products, totalVirtual, totalVariant });
} else if(query.json.query === "*:*") {
showToast(translate("Products not found"));
commit(types.PRODUCT_LIST_UPDATED, { products: [], totalVirtual: 0, totalVariant: 0 });
} else {
showToast(translate("Products not found"));
commit(types.PRODUCT_LIST_UPDATED, { products: [], totalVirtual: state.products.total.virtual, totalVariant: state.products.total.variant });
commit(types.PRODUCT_LIST_UPDATED, { products: [], totalVirtual: query.json.query === "*:*" ? 0 : state.products.total.virtual, totalVariant: query.json.query === "*:*" ? 0 : state.products.total.variant });
}
} catch (error) {
console.error(error);
Expand Down

0 comments on commit 6ab8de4

Please sign in to comment.