aboutsummaryrefslogtreecommitdiff
path: root/src/components/bookmark_timeline/bookmark_timeline.js
blob: 9571d630f2fc9f91171ce059e9c5a3184bf13555 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import Timeline from '../timeline/timeline.vue'

const Bookmarks = {
  created () {
    this.$store.commit('clearTimeline', { timeline: 'bookmarks' })
    this.$store.dispatch('startFetchingTimeline', { timeline: 'bookmarks', bookmarkFolderId: this.folderId || null })
  },
  components: {
    Timeline
  },
  computed: {
    folderId () {
      return this.$route.params.id
    },
    timeline () {
      return this.$store.state.statuses.timelines.bookmarks
    }
  },
  watch: {
    folderId () {
      this.$store.commit('clearTimeline', { timeline: 'bookmarks' })
      this.$store.dispatch('stopFetchingTimeline', 'bookmarks')
      this.$store.dispatch('startFetchingTimeline', { timeline: 'bookmarks', bookmarkFolderId: this.folderId || null })
    }
  },
  unmounted () {
    this.$store.commit('clearTimeline', { timeline: 'bookmarks' })
    this.$store.dispatch('stopFetchingTimeline', 'bookmarks')
  }
}

export default Bookmarks