pleroma-fe/src/components/bookmark_timeline/bookmark_timeline.js
marcin mikołajczak 9e45228823 Bookmark folders
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-09-23 23:13:40 +02:00

32 lines
942 B
JavaScript

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