瀏覽代碼

:recycle: forcing reload of events and exhibitions in sidebar

tags/0.9.0
J 4 年之前
父節點
當前提交
9ee032473b

+ 2
- 1
vue-theme/src/components/sidebars/events.vue 查看文件

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

+ 2
- 1
vue-theme/src/components/sidebars/exhibitions.vue 查看文件

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

+ 1
- 2
vue-theme/src/store/modules/exhibition.js 查看文件

12
     allExhibitions: state => state.all,
12
     allExhibitions: state => state.all,
13
     allExhibitionsLoaded: state => state.loaded,
13
     allExhibitionsLoaded: state => state.loaded,
14
     pastExhibitions: state => state.all.filter(exhibition => parseInt(exhibition.end) > now),
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
 const actions = {
18
 const actions = {

Loading…
取消
儲存