Fix: #517 「絵文字リアクション機能を使用する」設定を無効にしている時、絵文字リアクションの通知も表示されないようにする (#537)

* Fix: 新規登録のテストが特定時刻で落ちる問題

* Fix: #517 「絵文字リアクション機能を使用する」設定を無効にしている時、絵文字リアクションの通知も表示されないようにする
This commit is contained in:
KMY(雪あすか) 2024-02-13 09:06:43 +09:00 committed by GitHub
parent 841cc26963
commit bc0fefe76d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 30 additions and 19 deletions

View file

@ -4,7 +4,7 @@ import { defineMessages } from 'react-intl';
import { List as ImmutableList } from 'immutable';
import { compareId } from 'mastodon/compare_id';
import { usePendingItems as preferPendingItems } from 'mastodon/initial_state';
import { enableEmojiReaction, usePendingItems as preferPendingItems } from 'mastodon/initial_state';
import api, { getLinks } from '../api';
import { unescapeHTML } from '../utils/html';
@ -175,11 +175,16 @@ export function expandNotifications({ maxId, forceLoad } = {}, done = noOp) {
}
}
let exclude_types = activeFilter === 'all'
? excludeTypesFromSettings(getState())
: excludeTypesFromFilter(activeFilter);
if (!enableEmojiReaction && !exclude_types.includes('emoji_reaction')) {
exclude_types.push('emoji_reaction');
}
const params = {
max_id: maxId,
exclude_types: activeFilter === 'all'
? excludeTypesFromSettings(getState())
: excludeTypesFromFilter(activeFilter),
exclude_types,
};
if (!params.max_id && (notifications.get('items', ImmutableList()).size + notifications.get('pendingItems', ImmutableList()).size) > 0) {