mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-22 05:58:07 +01:00
Merge commit from fork
Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
This commit is contained in:
parent
6a233cbfcf
commit
d8f9db547a
1 changed files with 4 additions and 5 deletions
|
@ -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…
Reference in a new issue