* Fix: 新規登録のテストが特定時刻で落ちる問題 * Fix: #517 「絵文字リアクション機能を使用する」設定を無効にしている時、絵文字リアクションの通知も表示されないようにする
This commit is contained in:
parent
841cc26963
commit
bc0fefe76d
3 changed files with 30 additions and 19 deletions
|
@ -4,7 +4,7 @@ import { defineMessages } from 'react-intl';
|
||||||
import { List as ImmutableList } from 'immutable';
|
import { List as ImmutableList } from 'immutable';
|
||||||
|
|
||||||
import { compareId } from 'mastodon/compare_id';
|
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 api, { getLinks } from '../api';
|
||||||
import { unescapeHTML } from '../utils/html';
|
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 = {
|
const params = {
|
||||||
max_id: maxId,
|
max_id: maxId,
|
||||||
exclude_types: activeFilter === 'all'
|
exclude_types,
|
||||||
? excludeTypesFromSettings(getState())
|
|
||||||
: excludeTypesFromFilter(activeFilter),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!params.max_id && (notifications.get('items', ImmutableList()).size + notifications.get('pendingItems', ImmutableList()).size) > 0) {
|
if (!params.max_id && (notifications.get('items', ImmutableList()).size + notifications.get('pendingItems', ImmutableList()).size) > 0) {
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { FormattedMessage } from 'react-intl';
|
||||||
|
|
||||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
|
|
||||||
|
import { enableEmojiReaction } from 'mastodon/initial_state';
|
||||||
import { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_REPORTS } from 'mastodon/permissions';
|
import { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_REPORTS } from 'mastodon/permissions';
|
||||||
|
|
||||||
import ClearColumnButton from './clear_column_button';
|
import ClearColumnButton from './clear_column_button';
|
||||||
|
@ -124,16 +125,18 @@ export default class ColumnSettings extends PureComponent {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div role='group' aria-labelledby='notifications-emoji_reaction'>
|
{enableEmojiReaction && (
|
||||||
<span id='notifications-emoji_reaction' className='column-settings__section'><FormattedMessage id='notifications.column_settings.emoji_reaction' defaultMessage='Stamps:' /></span>
|
<div role='group' aria-labelledby='notifications-emoji_reaction'>
|
||||||
|
<span id='notifications-emoji_reaction' className='column-settings__section'><FormattedMessage id='notifications.column_settings.emoji_reaction' defaultMessage='Stamps:' /></span>
|
||||||
|
|
||||||
<div className='column-settings__row'>
|
<div className='column-settings__row'>
|
||||||
<SettingToggle disabled={browserPermission === 'denied'} prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'emoji_reaction']} onChange={onChange} label={alertStr} />
|
<SettingToggle disabled={browserPermission === 'denied'} prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'emoji_reaction']} onChange={onChange} label={alertStr} />
|
||||||
{showPushSettings && <SettingToggle prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'emoji_reaction']} onChange={this.onPushChange} label={pushStr} />}
|
{showPushSettings && <SettingToggle prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'emoji_reaction']} onChange={this.onPushChange} label={pushStr} />}
|
||||||
<SettingToggle prefix='notifications' settings={settings} settingPath={['shows', 'emoji_reaction']} onChange={onChange} label={showStr} />
|
<SettingToggle prefix='notifications' settings={settings} settingPath={['shows', 'emoji_reaction']} onChange={onChange} label={showStr} />
|
||||||
<SettingToggle prefix='notifications' settings={settings} settingPath={['sounds', 'emoji_reaction']} onChange={onChange} label={soundStr} />
|
<SettingToggle prefix='notifications' settings={settings} settingPath={['sounds', 'emoji_reaction']} onChange={onChange} label={soundStr} />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)}
|
||||||
|
|
||||||
<div role='group' aria-labelledby='notifications-mention'>
|
<div role='group' aria-labelledby='notifications-mention'>
|
||||||
<span id='notifications-mention' className='column-settings__section'><FormattedMessage id='notifications.column_settings.mention' defaultMessage='Mentions:' /></span>
|
<span id='notifications-mention' className='column-settings__section'><FormattedMessage id='notifications.column_settings.mention' defaultMessage='Mentions:' /></span>
|
||||||
|
|
|
@ -12,6 +12,7 @@ import RepeatIcon from '@/material-icons/400-24px/repeat.svg?react';
|
||||||
import ReplyAllIcon from '@/material-icons/400-24px/reply_all.svg?react';
|
import ReplyAllIcon from '@/material-icons/400-24px/reply_all.svg?react';
|
||||||
import StarIcon from '@/material-icons/400-24px/star.svg?react';
|
import StarIcon from '@/material-icons/400-24px/star.svg?react';
|
||||||
import { Icon } from 'mastodon/components/icon';
|
import { Icon } from 'mastodon/components/icon';
|
||||||
|
import { enableEmojiReaction } from 'mastodon/initial_state';
|
||||||
|
|
||||||
const tooltips = defineMessages({
|
const tooltips = defineMessages({
|
||||||
mentions: { id: 'notifications.filter.mentions', defaultMessage: 'Mentions' },
|
mentions: { id: 'notifications.filter.mentions', defaultMessage: 'Mentions' },
|
||||||
|
@ -85,13 +86,15 @@ class FilterBar extends PureComponent {
|
||||||
>
|
>
|
||||||
<Icon id='star' icon={StarIcon} />
|
<Icon id='star' icon={StarIcon} />
|
||||||
</button>
|
</button>
|
||||||
<button
|
{enableEmojiReaction && (
|
||||||
className={selectedFilter === 'emoji_reaction' ? 'active' : ''}
|
<button
|
||||||
onClick={this.onClick('emoji_reaction')}
|
className={selectedFilter === 'emoji_reaction' ? 'active' : ''}
|
||||||
title={intl.formatMessage(tooltips.emojiReactions)}
|
onClick={this.onClick('emoji_reaction')}
|
||||||
>
|
title={intl.formatMessage(tooltips.emojiReactions)}
|
||||||
<Icon id='smile-o' icon={EmojiReactionIcon} fixedWidth />
|
>
|
||||||
</button>
|
<Icon id='smile-o' icon={EmojiReactionIcon} fixedWidth />
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
<button
|
<button
|
||||||
className={selectedFilter === 'reblog' ? 'active' : ''}
|
className={selectedFilter === 'reblog' ? 'active' : ''}
|
||||||
onClick={this.onClick('reblog')}
|
onClick={this.onClick('reblog')}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue