about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-05-04 01:42:03 +0200
committerGitHub <noreply@github.com>2017-05-04 01:42:03 +0200
commit4fcc0d5ac9e734deeadf305d3fc4b9c6b41b0a84 (patch)
tree46862be2fbdce9c1f163de1aa91a94084b86d30d
parent3b51581f1be3c7e825dd87fadbe0a7264c7bcddc (diff)
Fix #2725 (#2774)
-rw-r--r--app/javascript/mastodon/features/compose/containers/warning_container.js5
1 files 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 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={<FormattedMessage
           id='compose_form.privacy_disclaimer'
           defaultMessage='Your private status will be delivered to mentioned users on {domains}. Do you trust {domainsCount, plural, one {that server} other {those servers}}? Post privacy only works on Mastodon instances. If {domains} {domainsCount, plural, one {is not a Mastodon instance} other {are not Mastodon instances}}, there will be no indication that your post is private, and it may be boosted or otherwise made visible to unintended recipients.'
-          values={{ domains: <strong>{mentionedDomains.join(', ')}</strong>, domainsCount: mentionedDomains.length }}
+          values={{ domains: <strong>{mentionedDomains.join(', ')}</strong>, domainsCount: mentionedDomains.size }}
         />}
       />
     );