aboutsummaryrefslogtreecommitdiff
path: root/src/components/nav_panel
diff options
context:
space:
mode:
authorShpuld Shpludson <shp@cock.li>2019-03-01 18:03:30 +0000
committerShpuld Shpludson <shp@cock.li>2019-03-01 18:03:30 +0000
commit53e104dc32080965a5a28ec37975b0c229a7d083 (patch)
tree8247646306bd1279b3464f7d3387ec12371ba94f /src/components/nav_panel
parentbbe4f3e3af54bfcb6f53bc57f66f790f4163bfb0 (diff)
parentcccf33d6ddc48038e643e651bd4cddc3355dbf18 (diff)
Merge branch 'issue-388-request-count-broken' into 'develop'
#388: get follow request on a real-time basis Closes #388 See merge request pleroma/pleroma-fe!619
Diffstat (limited to 'src/components/nav_panel')
-rw-r--r--src/components/nav_panel/nav_panel.js13
-rw-r--r--src/components/nav_panel/nav_panel.vue4
2 files changed, 15 insertions, 2 deletions
diff --git a/src/components/nav_panel/nav_panel.js b/src/components/nav_panel/nav_panel.js
index ea5d7ea4..aa3f7605 100644
--- a/src/components/nav_panel/nav_panel.js
+++ b/src/components/nav_panel/nav_panel.js
@@ -1,10 +1,23 @@
+import followRequestFetcher from '../../services/follow_request_fetcher/follow_request_fetcher.service'
+
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: {
currentUser () {
return this.$store.state.users.currentUser
},
chat () {
return this.$store.state.chat.channel
+ },
+ followRequestCount () {
+ return this.$store.state.api.followRequests.length
}
}
}
diff --git a/src/components/nav_panel/nav_panel.vue b/src/components/nav_panel/nav_panel.vue
index 1a269adf..7a7212fb 100644
--- a/src/components/nav_panel/nav_panel.vue
+++ b/src/components/nav_panel/nav_panel.vue
@@ -20,8 +20,8 @@
<li v-if='currentUser && currentUser.locked'>
<router-link :to="{ name: 'friend-requests' }">
{{ $t("nav.friend_requests")}}
- <span v-if='currentUser.follow_request_count > 0' class="badge follow-request-count">
- {{currentUser.follow_request_count}}
+ <span v-if='followRequestCount > 0' class="badge follow-request-count">
+ {{followRequestCount}}
</span>
</router-link>
</li>