|
|
@ -44,11 +44,17 @@ const Followers: React.FC<IFollowers> = (props) => {
|
|
|
|
const accountIds = useAppSelector(state => state.user_lists.followers.get(account!?.id)?.items || ImmutableOrderedSet<string>());
|
|
|
|
const accountIds = useAppSelector(state => state.user_lists.followers.get(account!?.id)?.items || ImmutableOrderedSet<string>());
|
|
|
|
const hasMore = useAppSelector(state => !!state.user_lists.followers.get(account!?.id)?.next);
|
|
|
|
const hasMore = useAppSelector(state => !!state.user_lists.followers.get(account!?.id)?.next);
|
|
|
|
|
|
|
|
|
|
|
|
const unavailable = useAppSelector(state => {
|
|
|
|
const isUnavailable = useAppSelector(state => {
|
|
|
|
const blockedBy = state.relationships.getIn([account?.id, 'blocked_by']) === true;
|
|
|
|
const blockedBy = state.relationships.getIn([account?.id, 'blocked_by']) === true;
|
|
|
|
return isOwnAccount ? false : (blockedBy && !features.blockersVisible);
|
|
|
|
return isOwnAccount ? false : (blockedBy && !features.blockersVisible);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleLoadMore = useCallback(debounce(() => {
|
|
|
|
|
|
|
|
if (account) {
|
|
|
|
|
|
|
|
dispatch(expandFollowers(account.id));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, 300, { leading: true }), [account?.id]);
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
|
let promises = [];
|
|
|
|
let promises = [];
|
|
|
|
|
|
|
|
|
|
|
@ -69,12 +75,6 @@ const Followers: React.FC<IFollowers> = (props) => {
|
|
|
|
|
|
|
|
|
|
|
|
}, [account?.id, username]);
|
|
|
|
}, [account?.id, username]);
|
|
|
|
|
|
|
|
|
|
|
|
const handleLoadMore = useCallback(debounce(() => {
|
|
|
|
|
|
|
|
if (account) {
|
|
|
|
|
|
|
|
dispatch(expandFollowers(account.id));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, 300, { leading: true }), [account?.id]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (loading && accountIds.isEmpty()) {
|
|
|
|
if (loading && accountIds.isEmpty()) {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<Spinner />
|
|
|
|
<Spinner />
|
|
|
@ -87,7 +87,7 @@ const Followers: React.FC<IFollowers> = (props) => {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (unavailable) {
|
|
|
|
if (isUnavailable) {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className='empty-column-indicator'>
|
|
|
|
<div className='empty-column-indicator'>
|
|
|
|
<FormattedMessage id='empty_column.account_unavailable' defaultMessage='Profile unavailable' />
|
|
|
|
<FormattedMessage id='empty_column.account_unavailable' defaultMessage='Profile unavailable' />
|
|
|
|