From 6ab8de4e734ca076df339da3efc82cb26529bb14 Mon Sep 17 00:00:00 2001 From: shashwatbangar Date: Fri, 27 May 2022 18:06:06 +0530 Subject: [PATCH] Improved: Further optimzed - Threshold management(#2dmha76) code --- src/store/modules/product/actions.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/store/modules/product/actions.ts b/src/store/modules/product/actions.ts index f9da4b90..84a659c4 100644 --- a/src/store/modules/product/actions.ts +++ b/src/store/modules/product/actions.ts @@ -40,12 +40,9 @@ const actions: ActionTree = { 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);