mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-02-26 12:33:46 -05:00
[Glitch] Fix loading local accounts with extraneous domain part in WebUI
Port 65ea097f1df5f14a4b389aa6ec0b955f2066b41c to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
f685c953e5
commit
48c9192b47
@ -2,8 +2,13 @@ import { Map as ImmutableMap } from 'immutable';
|
|||||||
|
|
||||||
import { ACCOUNT_LOOKUP_FAIL } from '../actions/accounts';
|
import { ACCOUNT_LOOKUP_FAIL } from '../actions/accounts';
|
||||||
import { importAccounts } from '../actions/accounts_typed';
|
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();
|
const initialState = ImmutableMap();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user