aboutsummaryrefslogtreecommitdiff
path: root/src/services
diff options
context:
space:
mode:
Diffstat (limited to 'src/services')
-rw-r--r--src/services/api/api.service.js5
-rw-r--r--src/services/timeline_fetcher/timeline_fetcher.service.js4
2 files changed, 6 insertions, 3 deletions
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js
index 4ee95bd1..24b38dfd 100644
--- a/src/services/api/api.service.js
+++ b/src/services/api/api.service.js
@@ -41,6 +41,8 @@ const APPROVE_USER_URL = '/api/pleroma/friendships/approve'
const DENY_USER_URL = '/api/pleroma/friendships/deny'
const SUGGESTIONS_URL = '/api/v1/suggestions'
+const MASTODON_USER_FAVORITES_TIMELINE_URL = '/api/v1/favourites'
+
import { each, map } from 'lodash'
import 'whatwg-fetch'
@@ -300,10 +302,11 @@ const fetchTimeline = ({timeline, credentials, since = false, until = false, use
notifications: QVITTER_USER_NOTIFICATIONS_URL,
'publicAndExternal': PUBLIC_AND_EXTERNAL_TIMELINE_URL,
user: QVITTER_USER_TIMELINE_URL,
+ favorites: MASTODON_USER_FAVORITES_TIMELINE_URL,
tag: TAG_TIMELINE_URL
}
- let url = timelineUrls[timeline]
+ let url = timelineUrls[timeline.type || timeline]
let params = []
diff --git a/src/services/timeline_fetcher/timeline_fetcher.service.js b/src/services/timeline_fetcher/timeline_fetcher.service.js
index c2a7de56..6c9d59ff 100644
--- a/src/services/timeline_fetcher/timeline_fetcher.service.js
+++ b/src/services/timeline_fetcher/timeline_fetcher.service.js
@@ -3,7 +3,7 @@ import { camelCase } from 'lodash'
import apiService from '../api/api.service.js'
const update = ({store, statuses, timeline, showImmediately, userId}) => {
- const ccTimeline = camelCase(timeline)
+ const ccTimeline = typeof timeline === 'object' ? timeline : camelCase(timeline)
store.dispatch('setError', { value: false })
@@ -18,7 +18,7 @@ const update = ({store, statuses, timeline, showImmediately, userId}) => {
const fetchAndUpdate = ({store, credentials, timeline = 'friends', older = false, showImmediately = false, userId = false, tag = false, until}) => {
const args = { timeline, credentials }
const rootState = store.rootState || store.state
- const timelineData = rootState.statuses.timelines[camelCase(timeline)]
+ const timelineData = typeof timeline === 'object' ? timeline : rootState.statuses.timelines[camelCase(timeline)]
if (older) {
args['until'] = until || timelineData.minVisibleId