diff options
| author | Shpuld Shpuldson <shp@cock.li> | 2021-02-01 12:55:23 +0200 |
|---|---|---|
| committer | Shpuld Shpuldson <shp@cock.li> | 2021-02-01 12:55:23 +0200 |
| commit | 3822a73a49f82c71217bc610720324a4303626cf (patch) | |
| tree | aae217d5cd8b46e010250fa8960c1f9aa08f0e4e /src/services | |
| parent | 8334649c1137264f2987295847144fb1799e71c6 (diff) | |
Fix report modal not working, add include_types
Diffstat (limited to 'src/services')
| -rw-r--r-- | src/services/api/api.service.js | 8 | ||||
| -rw-r--r-- | src/services/notifications_fetcher/notifications_fetcher.service.js | 15 |
2 files changed, 22 insertions, 1 deletions
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 4e5f674b..9bc90887 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -498,7 +498,8 @@ const fetchTimeline = ({ userId = false, tag = false, withMuted = false, - replyVisibility = 'all' + replyVisibility = 'all', + includeTypes = [] }) => { const timelineUrls = { public: MASTODON_PUBLIC_TIMELINE, @@ -545,6 +546,11 @@ const fetchTimeline = ({ if (replyVisibility !== 'all') { params.push(['reply_visibility', replyVisibility]) } + if (includeTypes.length > 0) { + includeTypes.forEach(type => { + params.push(['include_types[]', type]) + }) + } params.push(['limit', 20]) diff --git a/src/services/notifications_fetcher/notifications_fetcher.service.js b/src/services/notifications_fetcher/notifications_fetcher.service.js index 91861b21..2da6d646 100644 --- a/src/services/notifications_fetcher/notifications_fetcher.service.js +++ b/src/services/notifications_fetcher/notifications_fetcher.service.js @@ -1,6 +1,18 @@ import apiService from '../api/api.service.js' import { promiseInterval } from '../promise_interval/promise_interval.js' +// For using include_types when fetching notifications. +// Note: chat_mention excluded as pleroma-fe polls them separately +const mastoApiNotificationTypes = [ + 'mention', + 'favourite', + 'reblog', + 'follow', + 'move', + 'pleroma:emoji_reaction', + 'pleroma:report' +] + const update = ({ store, notifications, older }) => { store.dispatch('addNewNotifications', { notifications, older }) } @@ -12,6 +24,9 @@ const fetchAndUpdate = ({ store, credentials, older = false }) => { const timelineData = rootState.statuses.notifications const hideMutedPosts = getters.mergedConfig.hideMutedPosts + if (rootState.users.currentUser.role === 'admin') { + args['includeTypes'] = mastoApiNotificationTypes + } args['withMuted'] = !hideMutedPosts args['timeline'] = 'notifications' |
