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);