diff --git a/src/boot/after_store.js b/src/boot/after_store.js index 65c4c9205..c5be7781f 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -260,12 +260,7 @@ const getNodeInfo = async ({ store }) => { store.dispatch('setInstanceOption', { name: 'safeDM', value: features.includes('safe_dm_mentions') }) store.dispatch('setInstanceOption', { name: 'shoutAvailable', value: features.includes('chat') }) store.dispatch('setInstanceOption', { name: 'pleromaChatMessagesAvailable', value: features.includes('pleroma_chat_messages') }) - store.dispatch('setInstanceOption', { - name: 'pleromaCustomEmojiReactionsAvailable', - value: - features.includes('pleroma_custom_emoji_reactions') || - features.includes('custom_emoji_reactions') - }) + store.dispatch('setInstanceOption', { name: 'pleromaCustomEmojiReactionsAvailable', value: features.includes('pleroma_custom_emoji_reactions') }) store.dispatch('setInstanceOption', { name: 'pleromaBookmarkFoldersAvailable', value: features.includes('pleroma:bookmark_folders') }) store.dispatch('setInstanceOption', { name: 'gopherAvailable', value: features.includes('gopher') }) store.dispatch('setInstanceOption', { name: 'pollsAvailable', value: features.includes('polls') }) diff --git a/src/modules/instance.js b/src/modules/instance.js index eff3d8870..39d1fc662 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -157,7 +157,6 @@ const defaultState = { pleromaCustomEmojiReactionsAvailable: false, pleromaBookmarkFoldersAvailable: false, pleromaPublicFavouritesAvailable: true, - statusNotificationTypeAvailable: true, gopherAvailable: false, mediaProxyAvailable: false, suggestionsEnabled: false, diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 5022e330d..6de94278e 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -759,7 +759,7 @@ const fetchTimeline = ({ if (replyVisibility !== 'all') { params.push(['reply_visibility', replyVisibility]) } - if (includeTypes.size > 0) { + if (includeTypes.length > 0) { includeTypes.forEach(type => { params.push(['include_types[]', type]) }) diff --git a/src/services/notifications_fetcher/notifications_fetcher.service.js b/src/services/notifications_fetcher/notifications_fetcher.service.js index 89e000dd6..06eddc2bd 100644 --- a/src/services/notifications_fetcher/notifications_fetcher.service.js +++ b/src/services/notifications_fetcher/notifications_fetcher.service.js @@ -5,24 +5,22 @@ import { promiseInterval } from '../promise_interval/promise_interval.js' const update = ({ store, notifications, older }) => { store.dispatch('addNewNotifications', { notifications, older }) } -// -// For using include_types when fetching notifications. -// Note: chat_mention excluded as pleroma-fe polls them separately -const mastoApiNotificationTypes = new Set([ - 'mention', - 'status', - 'favourite', - 'reblog', - 'follow', - 'follow_request', - 'move', - 'poll', - 'pleroma:emoji_reaction', - 'pleroma:report', - 'test' -]) const fetchAndUpdate = ({ store, credentials, older = false, since }) => { + // For using include_types when fetching notifications. + // Note: chat_mention excluded as pleroma-fe polls them separately + const mastoApiNotificationTypes = [ + 'mention', + 'status', + 'favourite', + 'reblog', + 'follow', + 'follow_request', + 'move', + 'poll', + 'pleroma:emoji_reaction', + 'pleroma:report' + ] const args = { credentials } const { getters } = store @@ -30,8 +28,8 @@ const fetchAndUpdate = ({ store, credentials, older = false, since }) => { const timelineData = rootState.notifications const hideMutedPosts = getters.mergedConfig.hideMutedPosts - if (rootState.instance.pleromaChatMessagesAvailable) { - mastoApiNotificationTypes.add('pleroma:chat_mention') + if (store.rootState.instance.pleromaChatMessagesAvailable) { + mastoApiNotificationTypes.push('pleroma:chat_mention') } args.includeTypes = mastoApiNotificationTypes @@ -77,17 +75,7 @@ const fetchNotifications = ({ store, args, older }) => { return apiService.fetchTimeline(args) .then((response) => { if (response.errors) { - if (response.status === 400 && response.statusText.includes('Invalid value for enum')) { - response - .statusText - .matchAll(/(\w+) - Invalid value for enum./g) - .toArray() - .map(x => x[1]) - .forEach(x => mastoApiNotificationTypes.delete(x)) - return fetchNotifications({ store, args, older }) - } else { - throw new Error(`${response.status} ${response.statusText}`) - } + throw new Error(`${response.status} ${response.statusText}`) } const notifications = response.data update({ store, notifications, older })