aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAriadne Conill <ariadne@dereferenced.org>2019-11-11 14:14:44 -0600
committerAriadne Conill <ariadne@dereferenced.org>2019-11-11 14:14:44 -0600
commit21f1637e437398ec56b6078cf28b58bd4a0299ba (patch)
treeb06b9e09bcef9cf4ab9b0011a7853c9d06a43e93 /src
parent99fd096ddd1cc657a86c41e7e96344b8bb1dc4de (diff)
nav panel: refactor to use vuex mapState
Diffstat (limited to 'src')
-rw-r--r--src/components/nav_panel/nav_panel.js17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/components/nav_panel/nav_panel.js b/src/components/nav_panel/nav_panel.js
index aa3f7605..bfcab62e 100644
--- a/src/components/nav_panel/nav_panel.js
+++ b/src/components/nav_panel/nav_panel.js
@@ -1,4 +1,5 @@
import followRequestFetcher from '../../services/follow_request_fetcher/follow_request_fetcher.service'
+import { mapState } from 'vuex'
const NavPanel = {
created () {
@@ -9,17 +10,11 @@ const NavPanel = {
followRequestFetcher.startFetching({ store, credentials })
}
},
- computed: {
- currentUser () {
- return this.$store.state.users.currentUser
- },
- chat () {
- return this.$store.state.chat.channel
- },
- followRequestCount () {
- return this.$store.state.api.followRequests.length
- }
- }
+ computed: mapState({
+ currentUser: state => state.users.currentUser,
+ chat: state => state.chat.channel,
+ followRequestCount: state => state.api.followRequests.length
+ })
}
export default NavPanel