diff options
| author | Shpuld Shpludson <shp@cock.li> | 2019-02-09 06:56:46 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2019-02-09 06:56:46 +0000 |
| commit | 5296d41372cc6c25aedcdf44ce8b866b57e3b04b (patch) | |
| tree | cd6ce603852439a48bf4a8bdf3ae55324c3e2bd5 /src/modules/api.js | |
| parent | 531f150dd31ffc11b6f67145f4245b20457544aa (diff) | |
| parent | 0dc7c45f324c246cc74c6ed55c006c67742c4139 (diff) | |
Merge branch 'fix/js-error-in-tag-page' into 'develop'
Fixed JS error in tag page
See merge request pleroma/pleroma-fe!543
Diffstat (limited to 'src/modules/api.js')
| -rw-r--r-- | src/modules/api.js | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/modules/api.js b/src/modules/api.js index 7bda13e7..31cb55c6 100644 --- a/src/modules/api.js +++ b/src/modules/api.js @@ -1,5 +1,4 @@ import backendInteractorService from '../services/backend_interactor_service/backend_interactor_service.js' -import {isArray} from 'lodash' import { Socket } from 'phoenix' const api = { @@ -34,20 +33,12 @@ const api = { } }, actions: { - startFetching (store, timeline) { - let userId = false - - // This is for user timelines - if (isArray(timeline)) { - userId = timeline[1] - timeline = timeline[0] - } - + startFetching (store, {timeline = 'friends', tag = false, userId = false}) { // Don't start fetching if we already are. - if (!store.state.fetchers[timeline]) { - const fetcher = store.state.backendInteractor.startFetching({timeline, store, userId}) - store.commit('addFetcher', {timeline, fetcher}) - } + if (store.state.fetchers[timeline]) return + + const fetcher = store.state.backendInteractor.startFetching({ timeline, store, userId, tag }) + store.commit('addFetcher', { timeline, fetcher }) }, stopFetching (store, timeline) { const fetcher = store.state.fetchers[timeline] |
