aboutsummaryrefslogtreecommitdiff
path: root/src/components/mentions/mentions.js
blob: 3563101bb21a3025aa75e3b8389e4b09266a7c95 (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
import Status from '../status/status.vue'
// Temporary
import { prepareStatus, updateTimestampsInStatuses } from '../../modules/statuses.js'
import { map } from 'lodash'

const Mentions = {
  data () {
    return {
      mentions: []
    }
  },
  computed: {
    username () {
      return this.$route.params.username
    }
  },
  components: {
    Status
  },
  created () {
    this.$store.state.api.backendInteractor.fetchMentions({username: this.username})
      .then((mentions) => {
        this.mentions = updateTimestampsInStatuses(map(mentions, prepareStatus))
      })
  }
}

export default Mentions