acctFull --> getAcct throughout the UI, make it stateful

This commit is contained in:
Alex Gleason
2021-04-10 14:13:07 -05:00
parent 4b5d22f172
commit e03f551676
10 changed files with 73 additions and 27 deletions

View File

@ -23,9 +23,13 @@ export const guessFqn = account => {
};
// user@domain even for local users
export const acctFull = account => {
return account.get('fqn') || guessFqn(account);
};
export const acctFull = account => (
account.get('fqn') || guessFqn(account)
);
export const getAcct = (account, displayFqn) => (
displayFqn === true ? acctFull(account) : account.get('acct')
);
export const isStaff = (account = ImmutableMap()) => (
[isAdmin, isModerator].some(f => f(account) === true)

View File

@ -0,0 +1,6 @@
import { getSoapboxConfig } from'soapbox/actions/soapbox';
export const displayFqn = state => {
const soapbox = getSoapboxConfig(state);
return soapbox.get('displayFqn');
};