Przeglądaj źródła

:recycle: stop using sortBy watching | watch exhibitions and events list for initPosts

tags/1.0.0^2
J 3 lat temu
rodzic
commit
2ca40e5fe8
2 zmienionych plików z 7 dodań i 4 usunięć
  1. 6
    4
      vue-theme/src/pages/list.vue
  2. 1
    0
      vue-theme/src/store/index.js

+ 6
- 4
vue-theme/src/pages/list.vue Wyświetl plik

172
         // _setHeroInfo(post) {} from mixin
172
         // _setHeroInfo(post) {} from mixin
173
         // _clearHero(store) {} from mixin
173
         // _clearHero(store) {} from mixin
174
         async checkAndSetHero(type) {
174
         async checkAndSetHero(type) {
175
+            console.log('hero type :', type)
175
             this._clearHero(this.$store)
176
             this._clearHero(this.$store)
176
             try {
177
             try {
177
                 const page = await this.getPage(type)
178
                 const page = await this.getPage(type)
238
             if(!postTypes.includes(newType)) return console.warn('Type not valid...')
239
             if(!postTypes.includes(newType)) return console.warn('Type not valid...')
239
 
240
 
240
             // Ignore some types with presorts so the sortBy watcher can handle them
241
             // Ignore some types with presorts so the sortBy watcher can handle them
241
-            const ignore = ['artist', 'event', 'exibition']
242
-            if(ignore.includes(newType)) return
242
+            const ignore = ['artist']
243
+            if(ignore.includes(newType)) {
244
+                return
245
+            }
243
             // Reset the search term betweem loads
246
             // Reset the search term betweem loads
244
             // so we initPostList() works correctly when 
247
             // so we initPostList() works correctly when 
245
             // navigating from search result to a type list page
248
             // navigating from search result to a type list page
248
         },
251
         },
249
         // Fires when navigating between pages with different sorts
252
         // Fires when navigating between pages with different sorts
250
         sortBy(newSort) {
253
         sortBy(newSort) {
251
-            // console.log('sort changed :', newSort)
252
             if(!Object.values(sortTypes).includes(newSort)) return
254
             if(!Object.values(sortTypes).includes(newSort)) return
253
-            this.initPostList()
255
+            // this.initPostList()
254
         },
256
         },
255
     },
257
     },
256
     mounted() {
258
     mounted() {

+ 1
- 0
vue-theme/src/store/index.js Wyświetl plik

41
 
41
 
42
 const mutations = {
42
 const mutations = {
43
     SET_HERO(state, hero) {
43
     SET_HERO(state, hero) {
44
+        console.log(hero)
44
         if (!hero.url) {
45
         if (!hero.url) {
45
             console.warn('No hero url to set')
46
             console.warn('No hero url to set')
46
             state.hero.url = null
47
             state.hero.url = null

Ładowanie…
Anuluj
Zapisz