diff --git a/app/javascript/mastodon/features/compose/containers/warning_container.js b/app/javascript/mastodon/features/compose/containers/warning_container.js index bf5e6a5f8..8e5c8405f 100644 --- a/app/javascript/mastodon/features/compose/containers/warning_container.js +++ b/app/javascript/mastodon/features/compose/containers/warning_container.js @@ -4,11 +4,12 @@ import Warning from '../components/warning'; import { createSelector } from 'reselect'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; +import { OrderedSet } from 'immutable'; const getMentionedUsernames = createSelector(state => state.getIn(['compose', 'text']), text => text.match(/(?:^|[^\/\w])@([a-z0-9_]+@[a-z0-9\.\-]+)/ig)); const getMentionedDomains = createSelector(getMentionedUsernames, mentionedUsernamesWithDomains => { - return mentionedUsernamesWithDomains !== null ? [...new Set(mentionedUsernamesWithDomains.map(item => item.split('@')[2]))] : []; + return OrderedSet(mentionedUsernamesWithDomains !== null ? mentionedUsernamesWithDomains.map(item => item.split('@')[2]) : []); }); const mapStateToProps = state => { @@ -31,7 +32,7 @@ const WarningWrapper = ({ needsLeakWarning, needsLockWarning, mentionedDomains } message={{mentionedDomains.join(', ')}, domainsCount: mentionedDomains.length }} + values={{ domains: {mentionedDomains.join(', ')}, domainsCount: mentionedDomains.size }} />} /> );