Skip to content

Commit

Permalink
Fix loading local accounts with extraneous domain part in WebUI (mast…
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire authored and pull[bot] committed Jul 1, 2024
1 parent a5e9208 commit 980e0bf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/javascript/mastodon/reducers/accounts_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 980e0bf

Please sign in to comment.