From a14ae886b926fe0530b27201cf2a42e114a04412 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 4 May 2017 01:42:03 +0200 Subject: [PATCH] Fix #2725 (#2774) --- .../features/compose/containers/warning_container.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/javascript/mastodon/features/compose/containers/warning_container.js b/app/javascript/mastodon/features/compose/containers/warning_container.js index bf5e6a5f8f..8e5c8405f8 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 }} />} /> );