Treat mentions more like a timeline.

This commit is contained in:
Roger Braun 2016-12-03 12:43:21 +01:00
parent df51d08814
commit 58ac8f51a2
4 changed files with 53 additions and 17 deletions

View file

@ -1,26 +1,25 @@
import Status from '../status/status.vue'
// Temporary
import { prepareStatus } from '../../modules/statuses.js'
import { map } from 'lodash'
import Timeline from '../timeline/timeline.vue'
const Mentions = {
data () {
return {
mentions: []
}
},
computed: {
username () {
return this.$route.params.username
},
timeline () {
return this.$store.state.statuses.timelines.mentions
}
},
components: {
Status
Timeline
},
created () {
this.$store.state.api.backendInteractor.fetchMentions({username: this.username})
.then((mentions) => {
this.mentions = map(mentions, prepareStatus)
this.$store.dispatch('addNewStatuses', {
statuses: mentions,
timeline: 'mentions',
showImmediately: true
})
})
}
}