Przeglądaj źródła

:recycle: init on sort watcher change

tags/0.9.0
J 4 lat temu
rodzic
commit
27068d7e3c
1 zmienionych plików z 3 dodań i 17 usunięć
  1. 3
    17
      vue-theme/src/pages/list.vue

+ 3
- 17
vue-theme/src/pages/list.vue Wyświetl plik

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

Ładowanie…
Anuluj
Zapisz