diff --git a/app/soapbox/features/followers/index.tsx b/app/soapbox/features/followers/index.tsx index 580d65026..8625f2142 100644 --- a/app/soapbox/features/followers/index.tsx +++ b/app/soapbox/features/followers/index.tsx @@ -44,11 +44,17 @@ const Followers: React.FC = (props) => { const accountIds = useAppSelector(state => state.user_lists.followers.get(account!?.id)?.items || ImmutableOrderedSet()); 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; return isOwnAccount ? false : (blockedBy && !features.blockersVisible); }); + const handleLoadMore = useCallback(debounce(() => { + if (account) { + dispatch(expandFollowers(account.id)); + } + }, 300, { leading: true }), [account?.id]); + useEffect(() => { let promises = []; @@ -69,12 +75,6 @@ const Followers: React.FC = (props) => { }, [account?.id, username]); - const handleLoadMore = useCallback(debounce(() => { - if (account) { - dispatch(expandFollowers(account.id)); - } - }, 300, { leading: true }), [account?.id]); - if (loading && accountIds.isEmpty()) { return ( @@ -87,7 +87,7 @@ const Followers: React.FC = (props) => { ); } - if (unavailable) { + if (isUnavailable) { return (
diff --git a/app/soapbox/features/following/index.tsx b/app/soapbox/features/following/index.tsx index 6ea7001b8..cd0a10351 100644 --- a/app/soapbox/features/following/index.tsx +++ b/app/soapbox/features/following/index.tsx @@ -44,11 +44,17 @@ const Following: React.FC = (props) => { const accountIds = useAppSelector(state => state.user_lists.following.get(account!?.id)?.items || ImmutableOrderedSet()); const hasMore = useAppSelector(state => !!state.user_lists.following.get(account!?.id)?.next); - const unavailable = useAppSelector(state => { + const isUnavailable = useAppSelector(state => { const blockedBy = state.relationships.getIn([account?.id, 'blocked_by']) === true; return isOwnAccount ? false : (blockedBy && !features.blockersVisible); }); + const handleLoadMore = useCallback(debounce(() => { + if (account) { + dispatch(expandFollowing(account.id)); + } + }, 300, { leading: true }), [account?.id]); + useEffect(() => { let promises = []; @@ -69,12 +75,6 @@ const Following: React.FC = (props) => { }, [account?.id, username]); - const handleLoadMore = useCallback(debounce(() => { - if (account) { - dispatch(expandFollowing(account.id)); - } - }, 300, { leading: true }), [account?.id]); - if (loading && accountIds.isEmpty()) { return ( @@ -87,7 +87,7 @@ const Following: React.FC = (props) => { ); } - if (unavailable) { + if (isUnavailable) { return (