瀏覽代碼

:recycle: trying reset intersection loader when navigating away

tags/0.9.0
J 4 年之前
父節點
當前提交
aecc35089a
共有 1 個文件被更改,包括 7 次插入6 次删除
  1. 7
    6
      vue-theme/src/pages/list.vue

+ 7
- 6
vue-theme/src/pages/list.vue 查看文件

@@ -204,12 +204,15 @@ export default {
204 204
         type(newType, oldType) {
205 205
             if(!postTypes.includes(newType)) return console.warn('type not found...')
206 206
                 
207
-            if(this._getSortBy() != sortTypes.material) {
208
-                this.setIntersectionLoader()
209
-            }
207
+            this.setIntersectionLoader()
210 208
             this.clearAndInitPostList()
211 209
         },
212 210
         $route(to, from) {
211
+            // Reset the intersection loader if navigating AWAY from material sort page
212
+            if(from.fullPath.includes(sortTypes.material)) {
213
+                this.setIntersectionLoader()
214
+            }
215
+
213 216
             // Check if we changed sort method
214 217
             // from no sort to sorted
215 218
             // or sorted to no sort
@@ -225,10 +228,8 @@ export default {
225 228
         }
226 229
     },
227 230
     mounted() {
231
+        this.setIntersectionLoader()
228 232
         this.clearAndInitPostList()
229
-        if(this._getSortBy() != sortTypes.material) {
230
-            this.setIntersectionLoader()
231
-        }
232 233
     },
233 234
     beforeDestroy() {
234 235
         this.unsetIntersectionLoader()

Loading…
取消
儲存