Add endorsed accounts to profiles in web UI (#34568)
This commit is contained in:
parent
b81c28e7dc
commit
79013c730d
21 changed files with 157 additions and 113 deletions
|
@ -1,12 +1,14 @@
|
|||
import { getAccountHidden } from 'mastodon/selectors/accounts';
|
||||
import { useAppSelector } from 'mastodon/store';
|
||||
|
||||
export function useAccountVisibility(accountId?: string) {
|
||||
const blockedBy = useAppSelector(
|
||||
(state) => !!state.relationships.getIn([accountId, 'blocked_by'], false),
|
||||
export function useAccountVisibility(accountId?: string | null) {
|
||||
const blockedBy = useAppSelector((state) =>
|
||||
accountId
|
||||
? !!state.relationships.getIn([accountId, 'blocked_by'], false)
|
||||
: false,
|
||||
);
|
||||
const suspended = useAppSelector(
|
||||
(state) => !!state.accounts.getIn([accountId, 'suspended'], false),
|
||||
const suspended = useAppSelector((state) =>
|
||||
accountId ? !!state.accounts.getIn([accountId, 'suspended'], false) : false,
|
||||
);
|
||||
const hidden = useAppSelector((state) =>
|
||||
accountId ? Boolean(getAccountHidden(state, accountId)) : false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue