Parcourir la source

:fire: removing some logs

tags/0.9.0
J il y a 4 ans
Parent
révision
ace686bec5
2 fichiers modifiés avec 8 ajouts et 27 suppressions
  1. 6
    22
      vue-theme/src/pages/list.vue
  2. 2
    5
      vue-theme/src/pages/single.vue

+ 6
- 22
vue-theme/src/pages/list.vue Voir le fichier

@@ -91,12 +91,6 @@ export default {
91 91
                       .filter(p => p)
92 92
                       .pop()
93 93
 
94
-            // console.log('Gettings posts:', this.type)
95
-            // if (!Object.values(sortTypes).includes(sort)) {
96
-            //     console.log('Sort not found:', sort)
97
-            //     sort = null
98
-            // }
99
-
100 94
             // Don't dispatch if there's no type
101 95
             if (this.type && this.dispatchName && clear) {
102 96
                 this.$store.dispatch(
@@ -146,11 +140,9 @@ export default {
146 140
                 page => page.slug == type + 's',
147 141
             )[0]
148 142
 
149
-
150 143
             // Clear the hero and bail
151 144
             if(!page) return this.clearHero()
152 145
 
153
-            console.log('setting hero:', page)
154 146
             let hero = { url: page.featured, heroType:'image' }
155 147
             if (
156 148
                 page.hero &&
@@ -187,24 +179,16 @@ export default {
187 179
         }
188 180
     },
189 181
     watch: {
190
-        $route(to, from) {
191
-            // Only grab the hero if moving to another list page
192
-            console.log(to.fullPath.split('/'))
193
-            if (to.fullPath.split('/').filter(p => p).length <= 1) {
182
+        $route(to) {
183
+            // Filter the path to remove blank strings and
184
+            // only grab the hero if moving to another list page
185
+            // eg. list page -> list page
186
+            const path = to.fullPath.split('/').filter(p => p)
187
+            if (path.length <= 1) {
194 188
                 this.clearHero()
195 189
                 this.checkAndSetHero(this.type)
196 190
             }
197 191
 
198
-            let sort = to.path
199
-                .split('/')
200
-                .filter(p => p)
201
-                .pop()
202
-
203
-            if (!Object.values(sortTypes).includes(sort)) {
204
-                // console.warn('sort not found:', sort)
205
-                sort = null
206
-            }
207
-
208 192
             // TODO: Track last loaded page per post type
209 193
             // Less http calls
210 194
             this.page = 1

+ 2
- 5
vue-theme/src/pages/single.vue Voir le fichier

@@ -236,9 +236,6 @@ export default {
236 236
                 singlePostData.id,
237 237
             )
238 238
             this.loading = false
239
-            
240
-            console.log('title case:',convertTitleCase(this.type))
241
-            console.log('hero to set:',singlePostData)
242 239
         },
243 240
 
244 241
         scrollTo(hashtag) {
@@ -258,8 +255,8 @@ export default {
258 255
         $route(to, from) {
259 256
             // Only load post data when
260 257
             //  navigating TO a single page
261
-            console.log(to.fullPath.split('/'))
262
-            if (to.fullPath.split('/').filter(p => p).length > 1) {
258
+            const path = to.fullPath.split('/').filter(p => p)
259
+            if (path.length > 1) {
263 260
                 this.clearHero()
264 261
                 this.loadPostData()
265 262
             }

Chargement…
Annuler
Enregistrer