aboutsummaryrefslogtreecommitdiff
path: root/src/components/nav_panel/nav_panel.js
blob: bfcab62e4e676a1929d16649909e7892b6168149 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import followRequestFetcher from '../../services/follow_request_fetcher/follow_request_fetcher.service'
import { mapState } from 'vuex'

const NavPanel = {
  created () {
    if (this.currentUser && this.currentUser.locked) {
      const store = this.$store
      const credentials = store.state.users.currentUser.credentials

      followRequestFetcher.startFetching({ store, credentials })
    }
  },
  computed: mapState({
    currentUser: state => state.users.currentUser,
    chat: state => state.chat.channel,
    followRequestCount: state => state.api.followRequests.length
  })
}

export default NavPanel