orderiom-api-package 0.4.62 → 0.4.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/modules/product.js +10 -1
package/package.json
CHANGED
package/src/modules/product.js
CHANGED
|
@@ -30,11 +30,15 @@ const state = () => ({
|
|
|
30
30
|
pinnedProducts: null,
|
|
31
31
|
showPinnedProducts: false,
|
|
32
32
|
fetchingProducts: false,
|
|
33
|
+
categoriesFetchedOnce: false,
|
|
33
34
|
});
|
|
34
35
|
const getters = {
|
|
35
36
|
fetchingProducts(state){
|
|
36
37
|
return !!state.fetchingProducts;
|
|
37
38
|
},
|
|
39
|
+
categoriesFetchedOnce(){
|
|
40
|
+
return !!state.categoriesFetchedOnce;
|
|
41
|
+
},
|
|
38
42
|
subCategories(state){
|
|
39
43
|
if(!state.products) return []
|
|
40
44
|
if(state.showPinnedProducts) {
|
|
@@ -158,6 +162,9 @@ const getters = {
|
|
|
158
162
|
}
|
|
159
163
|
}
|
|
160
164
|
const mutations = {
|
|
165
|
+
setCategoriesFetchedOnce(state){
|
|
166
|
+
state.setCategoriesFetchedOnce = true;
|
|
167
|
+
},
|
|
161
168
|
setFetchingProducts(state, isFetching){
|
|
162
169
|
state.fetchingProducts = isFetching;
|
|
163
170
|
},
|
|
@@ -316,7 +323,9 @@ const actions = {
|
|
|
316
323
|
return res
|
|
317
324
|
}).catch(
|
|
318
325
|
commonErrorCallback()
|
|
319
|
-
)
|
|
326
|
+
).finally(() => {
|
|
327
|
+
commit('setCategoriesFetchedOnce');
|
|
328
|
+
});
|
|
320
329
|
},
|
|
321
330
|
getProducts({ commit, state, rootState }, data) {
|
|
322
331
|
commit("setSelectedCategory", data.category);
|