Procházet zdrojové kódy

:bug: rename vuex sticky actions and mutations

tags/0.9.0
j před 4 roky
rodič
revize
2102847d9a

+ 0
- 1
vue-theme/src/pages/index.vue Zobrazit soubor

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

+ 1
- 0
vue-theme/src/pages/list.vue Zobrazit soubor

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

+ 7
- 7
vue-theme/src/store/modules/sticky.js Zobrazit soubor

@@ -12,23 +12,23 @@ const getters = {
12 12
 
13 13
 const actions = {
14 14
     getAllSticky({ commit }, sortType) {
15
-        commit('CLEAR_POSTS')
16
-        commit('POSTS_LOADED', false)
15
+        commit('CLEAR_STICKY')
16
+        commit('STICKY_LOADED', false)
17 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 24
 const mutations = {
25
-    STORE_FETCHED_POSTS(state, { posts }) {
25
+    STORE_FETCHED_STICKY(state, { posts }) {
26 26
         state.all = posts
27 27
     },
28
-    CLEAR_POSTS(state) {
28
+    CLEAR_STICKY(state) {
29 29
         state.all = []
30 30
     },
31
-    POSTS_LOADED(state, val) {
31
+    STICKY_LOADED(state, val) {
32 32
         state.loaded = val
33 33
     },
34 34
 }

Načítá se…
Zrušit
Uložit