1
0
Fork 0
forked from srxl/akkoma-fe

nav panel: refactor to use vuex mapState

This commit is contained in:
Ariadne Conill 2019-11-11 14:14:44 -06:00
parent 99fd096ddd
commit 21f1637e43

View file

@ -1,4 +1,5 @@
import followRequestFetcher from '../../services/follow_request_fetcher/follow_request_fetcher.service' import followRequestFetcher from '../../services/follow_request_fetcher/follow_request_fetcher.service'
import { mapState } from 'vuex'
const NavPanel = { const NavPanel = {
created () { created () {
@ -9,17 +10,11 @@ const NavPanel = {
followRequestFetcher.startFetching({ store, credentials }) followRequestFetcher.startFetching({ store, credentials })
} }
}, },
computed: { computed: mapState({
currentUser () { currentUser: state => state.users.currentUser,
return this.$store.state.users.currentUser chat: state => state.chat.channel,
}, followRequestCount: state => state.api.followRequests.length
chat () { })
return this.$store.state.chat.channel
},
followRequestCount () {
return this.$store.state.api.followRequests.length
}
}
} }
export default NavPanel export default NavPanel