mirror of
https://git.bsd.gay/fef/nyastodon.git
synced 2024-12-25 19:03:43 +01:00
Fix loading local accounts with extraneous domain part in WebUI (#28559)
This commit is contained in:
parent
1184887b01
commit
65ea097f1d
1 changed files with 6 additions and 1 deletions
|
@ -2,8 +2,13 @@ import { Map as ImmutableMap } from 'immutable';
|
|||
|
||||
import { ACCOUNT_LOOKUP_FAIL } from '../actions/accounts';
|
||||
import { importAccounts } from '../actions/accounts_typed';
|
||||
import { domain } from '../initial_state';
|
||||
|
||||
export const normalizeForLookup = str => str.toLowerCase();
|
||||
export const normalizeForLookup = str => {
|
||||
str = str.toLowerCase();
|
||||
const trailingIndex = str.indexOf(`@${domain.toLowerCase()}`);
|
||||
return (trailingIndex > 0) ? str.slice(0, trailingIndex) : str;
|
||||
};
|
||||
|
||||
const initialState = ImmutableMap();
|
||||
|
||||
|
|
Loading…
Reference in a new issue