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

:recycle: forcing reload of events and exhibitions in sidebar

tags/0.9.0
J 4 лет назад
Родитель
Сommit
9ee032473b

+ 2
- 1
vue-theme/src/components/sidebars/events.vue Просмотреть файл

@@ -32,6 +32,7 @@ export default {
32 32
     },
33 33
     methods: {
34 34
         async getPosts() {
35
+            this.$store.commit('CLEAR_EVENTS')
35 36
             const upcoming = this.$store.dispatch(
36 37
                 `getAllEvents`,
37 38
                 {
@@ -49,7 +50,7 @@ export default {
49 50
         },
50 51
     },
51 52
     created() {
52
-        if (!this.loaded) this.getPosts()
53
+        this.getPosts()
53 54
     },
54 55
 }
55 56
 </script>

+ 2
- 1
vue-theme/src/components/sidebars/exhibitions.vue Просмотреть файл

@@ -32,6 +32,7 @@ export default {
32 32
     },
33 33
     methods: {
34 34
         async getPosts() {
35
+            this.$store.commit('CLEAR_EXHIBITIONS')
35 36
             const upcoming = this.$store.dispatch(
36 37
                 `getAllExhibitions`,
37 38
                 {
@@ -49,7 +50,7 @@ export default {
49 50
         },
50 51
     },
51 52
     created() {
52
-        if (!this.loaded) this.getPosts()
53
+        this.getPosts()
53 54
     },
54 55
 }
55 56
 </script>

+ 1
- 2
vue-theme/src/store/modules/exhibition.js Просмотреть файл

@@ -12,8 +12,7 @@ const getters = {
12 12
     allExhibitions: state => state.all,
13 13
     allExhibitionsLoaded: state => state.loaded,
14 14
     pastExhibitions: state => state.all.filter(exhibition => parseInt(exhibition.end) > now),
15
-    upcomingAndCurrentExhibitions: state => state.all,
16
-    // upcomingAndCurrentExhibitions: state => state.all.filter(exhibition => parseInt(exhibition.end) <= now)
15
+    upcomingAndCurrentExhibitions: state => state.all.filter(exhibition => parseInt(exhibition.end) <= now)
17 16
 }
18 17
 
19 18
 const actions = {

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