Pārlūkot izejas kodu

:recycle: init on sort change before type

tags/0.9.0
J 4 gadus atpakaļ
vecāks
revīzija
176344013d
1 mainītis faili ar 6 papildinājumiem un 7 dzēšanām
  1. 6
    7
      vue-theme/src/pages/list.vue

+ 6
- 7
vue-theme/src/pages/list.vue Parādīt failu

@@ -210,16 +210,15 @@ export default {
210 210
             // They're often loaded from sidebar
211 211
             const ignoredFromTypeChange = ['event', 'exhibition']
212 212
             if (
213
-                typeFromRoute(to) != typeFromRoute(from)
214
-            ) {
215
-                this.clearAndInitPostList('type change')
216
-            }
217
-            else if (
218
-                typeFromRoute(to) == typeFromRoute(from) &&
219 213
                 // Post slug sometimes appears as a sort so we check it against known sorts
220
-                validSorts.includes(to.sortBy) && validSorts.includes(from.sortBy)
214
+                validSorts.includes(to.sortBy) &&
215
+                to.sortBy != from.sortBy
221 216
             ) {
222 217
                 this.clearAndInitPostList('sort change')
218
+            } else if (
219
+                typeFromRoute(to) != typeFromRoute(from)
220
+            ) {
221
+                this.clearAndInitPostList('type change')
223 222
             } 
224 223
         }
225 224
     },

Notiek ielāde…
Atcelt
Saglabāt