Преглед на файлове

:recycle: adding back type watch init

tags/0.9.0
J преди 4 години
родител
ревизия
a241182416
променени са 1 файла, в които са добавени 8 реда и са изтрити 4 реда
  1. 8
    4
      vue-theme/src/pages/list.vue

+ 8
- 4
vue-theme/src/pages/list.vue Целия файл

@@ -199,8 +199,13 @@ export default {
199 199
         // and the post type has changed
200 200
         type(newType, oldType) {
201 201
             if(!postTypes.includes(newType)) return console.warn('type not valid...')
202
-            // this.clearAndInitPostList('type watcher')
203
-            console.log('type watcher fired')
202
+
203
+            // Ignore event or exhibition because they're sortable
204
+            // They're often loaded from sidebar
205
+            const ignored = ['event', 'exhibition']
206
+            if(ignored.includes(this.type)) return
207
+            
208
+            this.clearAndInitPostList('type watcher')
204 209
         },
205 210
         // Only fire if the sort type has changed
206 211
         // and the post type is the same
@@ -209,11 +214,10 @@ export default {
209 214
             const validSorts = Object.values(sortTypes)
210 215
             if (
211 216
                 typeFromRoute(to) == typeFromRoute(from) &&
212
-                to.sortBy != from.sortBy &&
213 217
                 // Post slug sometimes appears as a sort so we check it against known sorts
214 218
                 validSorts.includes(to.sortBy) && validSorts.includes(from.sortBy)
215 219
             ) {
216
-                console.log('$route watcher fired')
220
+                console.log('$route watcher fired', to, from)
217 221
             } 
218 222
         }
219 223
     },

Loading…
Отказ
Запис