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

:recycle: running more computed obj checks

tags/1.0.1^2^2
J 3 лет назад
Родитель
Сommit
56d5eddd68
1 измененных файлов: 4 добавлений и 4 удалений
  1. 4
    4
      vue-theme/src/pages/single.vue

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

@@ -91,10 +91,10 @@ export default {
91 91
             if (!this.singlePost.galleries) return
92 92
             const galleries = []
93 93
             this.singlePost.galleries.forEach(gallery => {
94
-                const withImages = []
95
-                gallery.ids.forEach(imageId => {
96
-                    withImages.push(this.singlePost.attached[imageId])
97
-                })
94
+                if (!gallery.ids) return
95
+                const withImages = gallery.ids.map(
96
+                    imageId => this.singlePost.attached[imageId],
97
+                )
98 98
                 galleries.push(withImages)
99 99
             })
100 100
             return galleries

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