diff options
| author | taehoon <th.dev91@gmail.com> | 2019-03-02 08:07:14 -0500 |
|---|---|---|
| committer | taehoon <th.dev91@gmail.com> | 2019-03-21 16:33:02 -0400 |
| commit | 9857002bf5dc902302644e981712b611124a5845 (patch) | |
| tree | 9205be4537246756d5973c84a53c737262c75bc2 /src/services | |
| parent | 300259fd976bb4496c5e1cca0df9bd47a1947259 (diff) | |
Add hideMutedPosts setting and wire up to post-returning endpoints
Diffstat (limited to 'src/services')
| -rw-r--r-- | src/services/api/api.service.js | 3 | ||||
| -rw-r--r-- | src/services/timeline_fetcher/timeline_fetcher.service.js | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 14bc919f..73ea15aa 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -345,7 +345,7 @@ const fetchStatus = ({id, credentials}) => { .then((data) => parseStatus(data)) } -const fetchTimeline = ({timeline, credentials, since = false, until = false, userId = false, tag = false}) => { +const fetchTimeline = ({timeline, credentials, since = false, until = false, userId = false, tag = false, withMuted = false}) => { const timelineUrls = { public: PUBLIC_TIMELINE_URL, friends: FRIENDS_TIMELINE_URL, @@ -381,6 +381,7 @@ const fetchTimeline = ({timeline, credentials, since = false, until = false, use } params.push(['count', 20]) + params.push(['with_muted', withMuted]) const queryString = map(params, (param) => `${param[0]}=${param[1]}`).join('&') url += `?${queryString}` diff --git a/src/services/timeline_fetcher/timeline_fetcher.service.js b/src/services/timeline_fetcher/timeline_fetcher.service.js index 6f99616f..8e954cdf 100644 --- a/src/services/timeline_fetcher/timeline_fetcher.service.js +++ b/src/services/timeline_fetcher/timeline_fetcher.service.js @@ -19,6 +19,9 @@ const fetchAndUpdate = ({store, credentials, timeline = 'friends', older = false const args = { timeline, credentials } const rootState = store.rootState || store.state const timelineData = rootState.statuses.timelines[camelCase(timeline)] + const hideMutedPosts = typeof rootState.config.hideMutedPosts === 'undefined' + ? rootState.instance.hideMutedPosts + : rootState.config.hideMutedPosts if (older) { args['until'] = until || timelineData.minId @@ -28,6 +31,7 @@ const fetchAndUpdate = ({store, credentials, timeline = 'friends', older = false args['userId'] = userId args['tag'] = tag + args['withMuted'] = !hideMutedPosts const numStatusesBeforeFetch = timelineData.statuses.length |
