Просмотр исходного кода

:fire: removing some logs

tags/0.9.0
J 4 лет назад
Родитель
Сommit
ace686bec5
2 измененных файлов: 8 добавлений и 27 удалений
  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 Просмотреть файл

91
                       .filter(p => p)
91
                       .filter(p => p)
92
                       .pop()
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
             // Don't dispatch if there's no type
94
             // Don't dispatch if there's no type
101
             if (this.type && this.dispatchName && clear) {
95
             if (this.type && this.dispatchName && clear) {
102
                 this.$store.dispatch(
96
                 this.$store.dispatch(
146
                 page => page.slug == type + 's',
140
                 page => page.slug == type + 's',
147
             )[0]
141
             )[0]
148
 
142
 
149
-
150
             // Clear the hero and bail
143
             // Clear the hero and bail
151
             if(!page) return this.clearHero()
144
             if(!page) return this.clearHero()
152
 
145
 
153
-            console.log('setting hero:', page)
154
             let hero = { url: page.featured, heroType:'image' }
146
             let hero = { url: page.featured, heroType:'image' }
155
             if (
147
             if (
156
                 page.hero &&
148
                 page.hero &&
187
         }
179
         }
188
     },
180
     },
189
     watch: {
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
                 this.clearHero()
188
                 this.clearHero()
195
                 this.checkAndSetHero(this.type)
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
             // TODO: Track last loaded page per post type
192
             // TODO: Track last loaded page per post type
209
             // Less http calls
193
             // Less http calls
210
             this.page = 1
194
             this.page = 1

+ 2
- 5
vue-theme/src/pages/single.vue Просмотреть файл

236
                 singlePostData.id,
236
                 singlePostData.id,
237
             )
237
             )
238
             this.loading = false
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
         scrollTo(hashtag) {
241
         scrollTo(hashtag) {
258
         $route(to, from) {
255
         $route(to, from) {
259
             // Only load post data when
256
             // Only load post data when
260
             //  navigating TO a single page
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
                 this.clearHero()
260
                 this.clearHero()
264
                 this.loadPostData()
261
                 this.loadPostData()
265
             }
262
             }

Загрузка…
Отмена
Сохранить