Browse Source

Merge commit from fork

Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
dariusk-working/4_3_0
David Roetzel 2 years ago committed by GitHub
parent
commit
d8f9db547a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 9
      app/javascript/mastodon/reducers/accounts_map.js

9
app/javascript/mastodon/reducers/accounts_map.js

@ -4,11 +4,10 @@ import { ACCOUNT_LOOKUP_FAIL } from '../actions/accounts';
import { importAccounts } from '../actions/accounts_typed';
import { domain } from '../initial_state';
export const normalizeForLookup = str => {
str = str.toLowerCase();
const trailingIndex = str.indexOf(`@${domain.toLowerCase()}`);
return (trailingIndex > 0) ? str.slice(0, trailingIndex) : str;
};
const pattern = new RegExp(`@${domain}$`, 'gi');
export const normalizeForLookup = str =>
str.toLowerCase().replace(pattern, '');
const initialState = ImmutableMap();

Loading…
Cancel
Save