Skip to content

Commit

Permalink
[Glitch] Fix loading local accounts with extraneous domain part in WebUI
Browse files Browse the repository at this point in the history
Port 65ea097 to glitch-soc

Signed-off-by: Claire <[email protected]>
  • Loading branch information
ClearlyClaire committed Jan 2, 2024
1 parent f685c95 commit 48c9192
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/javascript/flavours/glitch/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 48c9192

Please sign in to comment.