Parcourir la source

:fire: removing list page call for posts | only use intersection handler

tags/0.9.0
J il y a 4 ans
Parent
révision
9709ffdbdd
1 fichiers modifiés avec 1 ajouts et 5 suppressions
  1. 1
    5
      vue-theme/src/pages/list.vue

+ 1
- 5
vue-theme/src/pages/list.vue Voir le fichier

54
         },
54
         },
55
         pType() {
55
         pType() {
56
             if(!this.type) return
56
             if(!this.type) return
57
-            console.log(this.type, `${convertTitleCase(this.type)}s`)
58
             return this.sortBy ? `${convertTitleCase(this.type.split('/')[0])}s` : `${convertTitleCase(this.type)}s`
57
             return this.sortBy ? `${convertTitleCase(this.type.split('/')[0])}s` : `${convertTitleCase(this.type)}s`
59
         },
58
         },
60
         loaded() {
59
         loaded() {
119
             const page = this.allPages.filter(
118
             const page = this.allPages.filter(
120
                 page => page.slug == type + 's',
119
                 page => page.slug == type + 's',
121
             )[0]
120
             )[0]
121
+            if(!page) return console.warn(`no page for ${type} found`)
122
 
122
 
123
             let json = { url: page.featured, heroType:'image' }
123
             let json = { url: page.featured, heroType:'image' }
124
             if (
124
             if (
176
     },
176
     },
177
     created() {
177
     created() {
178
         this.checkAndSetHero(this.type)
178
         this.checkAndSetHero(this.type)
179
-
180
-        // We also need to check if only ONE has been loaded because
181
-        // coming from the homepage there will only be 1 item
182
-        if (!this[`all${this.pType}Loaded`] || this[`all${this.pType}`].length < 2) this.getPosts(true)
183
     },
179
     },
184
 }
180
 }
185
 </script>
181
 </script>

Chargement…
Annuler
Enregistrer