logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://anongit.hacktivis.me/git/pleroma-fe.git/

bookmark_folders_fetcher.service.js (661B)


  1. import apiService from '../api/api.service.js'
  2. import { promiseInterval } from '../promise_interval/promise_interval.js'
  3. const fetchAndUpdate = ({ store, credentials }) => {
  4. return apiService.fetchBookmarkFolders({ credentials })
  5. .then(bookmarkFolders => {
  6. store.commit('setBookmarkFolders', bookmarkFolders)
  7. }, () => {})
  8. .catch(() => {})
  9. }
  10. const startFetching = ({ credentials, store }) => {
  11. const boundFetchAndUpdate = () => fetchAndUpdate({ credentials, store })
  12. boundFetchAndUpdate()
  13. return promiseInterval(boundFetchAndUpdate, 240000)
  14. }
  15. const bookmarkFoldersFetcher = {
  16. startFetching
  17. }
  18. export default bookmarkFoldersFetcher