aboutsummaryrefslogtreecommitdiff
path: root/src/components/timeline_menu/timeline_menu.js
blob: d35b77890995aae9292df81b4ce75545ce47069a (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
33
34
35
36
37
38
39
40
41
42
43
44
import Popover from '../popover/popover.vue'
import { mapState } from 'vuex'

const TimelineMenu = {
  components: {
    Popover
  },
  data () {
    return {
      isOpen: false
    }
  },
  created () {
    if (this.currentUser && this.currentUser.locked) {
      this.$store.dispatch('startFetchingFollowRequests')
    }
  },
  methods: {
    openMenu () {
      // Tried using $nextTick, but the animation wouldn't
      // play, I assume it played too quickly
      setTimeout(() => {
        this.isOpen = true
      }, 1)
    }
  },
  computed: {
    ...mapState({
      currentUser: state => state.users.currentUser,
      privateMode: state => state.instance.private,
      federating: state => state.instance.federating
    }),
    timelineNamesForRoute () {
      return {
        'friends': this.$t('nav.timeline'),
        'dms': this.$t('nav.dms'),
        'public-timeline': this.$t('nav.public_tl'),
        'public-external-timeline': this.$t('nav.twkn')
      }
    }
  }
}

export default TimelineMenu