You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
640 B
22 lines
640 B
import { getAccountHidden } from 'mastodon/selectors/accounts'; |
|
import { useAppSelector } from 'mastodon/store'; |
|
|
|
export function useAccountVisibility(accountId?: string | null) { |
|
const blockedBy = useAppSelector((state) => |
|
accountId |
|
? !!state.relationships.getIn([accountId, 'blocked_by'], false) |
|
: false, |
|
); |
|
const suspended = useAppSelector((state) => |
|
accountId ? !!state.accounts.getIn([accountId, 'suspended'], false) : false, |
|
); |
|
const hidden = useAppSelector((state) => |
|
accountId ? Boolean(getAccountHidden(state, accountId)) : false, |
|
); |
|
|
|
return { |
|
blockedBy, |
|
suspended, |
|
hidden, |
|
}; |
|
}
|
|
|