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
This commit is contained in:
commit
53e104dc32
6 changed files with 41 additions and 13 deletions
|
@ -0,0 +1,21 @@
|
|||
import apiService from '../api/api.service.js'
|
||||
|
||||
const fetchAndUpdate = ({ store, credentials }) => {
|
||||
return apiService.fetchFollowRequests({ credentials })
|
||||
.then((requests) => {
|
||||
store.commit('setFollowRequests', requests)
|
||||
}, () => {})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
const startFetching = ({credentials, store}) => {
|
||||
fetchAndUpdate({ credentials, store })
|
||||
const boundFetchAndUpdate = () => fetchAndUpdate({ credentials, store })
|
||||
return setInterval(boundFetchAndUpdate, 10000)
|
||||
}
|
||||
|
||||
const followRequestFetcher = {
|
||||
startFetching
|
||||
}
|
||||
|
||||
export default followRequestFetcher
|
Loading…
Add table
Add a link
Reference in a new issue