akkoma-fe/src/components/nav_panel/nav_panel.js

55 lines
1.3 KiB
JavaScript
Raw Normal View History

import { timelineNames } from '../timeline_menu/timeline_menu.js'
2020-05-07 13:10:53 +00:00
import { mapState, mapGetters } from 'vuex'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
faUsers,
2020-10-20 21:25:59 +00:00
faGlobe,
faBookmark,
faEnvelope,
faHome,
faComments,
faBell,
faInfoCircle
} from '@fortawesome/free-solid-svg-icons'
library.add(
faUsers,
2020-10-20 21:25:59 +00:00
faGlobe,
faBookmark,
faEnvelope,
faHome,
faComments,
faBell,
faInfoCircle
)
2016-11-06 19:10:20 +00:00
const NavPanel = {
created () {
if (this.currentUser && this.currentUser.locked) {
2020-01-21 15:51:49 +00:00
this.$store.dispatch('startFetchingFollowRequests')
}
},
computed: {
onTimelineRoute () {
return !!timelineNames()[this.$route.name]
},
timelinesRoute () {
if (this.$store.state.interface.lastTimeline) {
return this.$store.state.interface.lastTimeline
}
return this.currentUser ? 'friends' : 'public-timeline'
},
...mapState({
currentUser: state => state.users.currentUser,
followRequestCount: state => state.api.followRequests.length,
privateMode: state => state.instance.private,
2020-05-07 13:10:53 +00:00
federating: state => state.instance.federating,
pleromaChatMessagesAvailable: state => state.instance.pleromaChatMessagesAvailable
}),
...mapGetters(['unreadChatCount'])
}
2016-11-06 19:10:20 +00:00
}
export default NavPanel