Ver código fonte

:bug: rename vuex sticky actions and mutations

tags/0.9.0
j 4 anos atrás
pai
commit
2102847d9a

+ 0
- 1
vue-theme/src/pages/index.vue Ver arquivo

51
     mixins: [postTypeGetters, scrollTop],
51
     mixins: [postTypeGetters, scrollTop],
52
     created() {
52
     created() {
53
         // console.log(wp)
53
         // console.log(wp)
54
-        this.$store.dispatch(`getAllSticky`)
55
         postTypes.forEach(type => {
54
         postTypes.forEach(type => {
56
             const capitalizedType = convertTitleCase(type)
55
             const capitalizedType = convertTitleCase(type)
57
             this.$store.dispatch(`getAll${capitalizedType}`)
56
             this.$store.dispatch(`getAll${capitalizedType}`)

+ 1
- 0
vue-theme/src/pages/list.vue Ver arquivo

125
         console.log(`${type} already loaded?:`, this[`all${type}Loaded`])
125
         console.log(`${type} already loaded?:`, this[`all${type}Loaded`])
126
         
126
         
127
         this.checkAndSetHero(this.type)
127
         this.checkAndSetHero(this.type)
128
+        console.log(this.$store)
128
         if(!this[`all${type}Loaded`]) this.getPosts()
129
         if(!this[`all${type}Loaded`]) this.getPosts()
129
     }
130
     }
130
 }
131
 }

+ 7
- 7
vue-theme/src/store/modules/sticky.js Ver arquivo

12
 
12
 
13
 const actions = {
13
 const actions = {
14
     getAllSticky({ commit }, sortType) {
14
     getAllSticky({ commit }, sortType) {
15
-        commit('CLEAR_POSTS')
16
-        commit('POSTS_LOADED', false)
15
+        commit('CLEAR_STICKY')
16
+        commit('STICKY_LOADED', false)
17
         return api.getSticky(posts => {
17
         return api.getSticky(posts => {
18
-            commit('STORE_FETCHED_POSTS', { posts })
19
-            commit('POSTS_LOADED', true)
18
+            commit('STORE_FETCHED_STICKY', { posts })
19
+            commit('STICKY_LOADED', true)
20
         })
20
         })
21
     },
21
     },
22
 }
22
 }
23
 
23
 
24
 const mutations = {
24
 const mutations = {
25
-    STORE_FETCHED_POSTS(state, { posts }) {
25
+    STORE_FETCHED_STICKY(state, { posts }) {
26
         state.all = posts
26
         state.all = posts
27
     },
27
     },
28
-    CLEAR_POSTS(state) {
28
+    CLEAR_STICKY(state) {
29
         state.all = []
29
         state.all = []
30
     },
30
     },
31
-    POSTS_LOADED(state, val) {
31
+    STICKY_LOADED(state, val) {
32
         state.loaded = val
32
         state.loaded = val
33
     },
33
     },
34
 }
34
 }

Carregando…
Cancelar
Salvar