diff --git a/src/actions/suggestions.ts b/src/actions/suggestions.ts index ae1b4aaca..4c2584856 100644 --- a/src/actions/suggestions.ts +++ b/src/actions/suggestions.ts @@ -56,12 +56,9 @@ const fetchSuggestionsV2 = (params: Record = {}) => const fetchSuggestions = (params: Record = { limit: 50 }) => (dispatch: AppDispatch, getState: () => RootState) => { const state = getState(); - const me = state.me; const instance = state.instance; const features = getFeatures(instance); - if (!me) return null; - if (features.suggestionsV2) { return dispatch(fetchSuggestionsV2(params)) .then((suggestions: APIEntity[]) => { diff --git a/src/features/ui/components/who-to-follow-panel.tsx b/src/features/ui/components/who-to-follow-panel.tsx index 8b6486a08..f2b8dbed0 100644 --- a/src/features/ui/components/who-to-follow-panel.tsx +++ b/src/features/ui/components/who-to-follow-panel.tsx @@ -5,6 +5,7 @@ import { Link } from 'react-router-dom'; import { Text, Widget } from 'soapbox/components/ui'; import AccountContainer from 'soapbox/containers/account-container'; import PlaceholderSidebarSuggestions from 'soapbox/features/placeholder/components/placeholder-sidebar-suggestions'; +import { useOwnAccount } from 'soapbox/hooks'; import { useDismissSuggestion, useSuggestions } from 'soapbox/queries/suggestions'; import type { Account as AccountEntity } from 'soapbox/types/entities'; @@ -20,6 +21,7 @@ interface IWhoToFollowPanel { const WhoToFollowPanel = ({ limit }: IWhoToFollowPanel) => { const intl = useIntl(); + const { account } = useOwnAccount(); const { data: suggestions, isFetching } = useSuggestions(); const dismissSuggestion = useDismissSuggestion(); @@ -54,7 +56,7 @@ const WhoToFollowPanel = ({ limit }: IWhoToFollowPanel) => { id={suggestion.account} actionIcon={require('@tabler/icons/outline/x.svg')} actionTitle={intl.formatMessage(messages.dismissSuggestion)} - onActionClick={handleDismiss} + onActionClick={account ? handleDismiss : undefined} /> )) )} diff --git a/src/pages/default-page.tsx b/src/pages/default-page.tsx index dc273d956..417d578b9 100644 --- a/src/pages/default-page.tsx +++ b/src/pages/default-page.tsx @@ -36,7 +36,7 @@ const DefaultPage: React.FC = ({ children }) => { {features.trends && ( )} - {me && features.suggestions && ( + {features.suggestions && ( )} diff --git a/src/pages/home-page.tsx b/src/pages/home-page.tsx index 3f292eacb..5087f2990 100644 --- a/src/pages/home-page.tsx +++ b/src/pages/home-page.tsx @@ -108,7 +108,7 @@ const HomePage: React.FC = ({ children }) => { {features.trends && ( )} - {me && features.suggestions && ( + {features.suggestions && ( )} diff --git a/src/pages/landing-page.tsx b/src/pages/landing-page.tsx index e64cbce9a..88d13090f 100644 --- a/src/pages/landing-page.tsx +++ b/src/pages/landing-page.tsx @@ -5,6 +5,7 @@ import { TrendsPanel, SignUpPanel, CtaBanner, + WhoToFollowPanel, } from 'soapbox/features/ui/util/async-components'; import { useAppSelector, useFeatures } from 'soapbox/hooks'; @@ -35,6 +36,9 @@ const LandingPage: React.FC = ({ children }) => { {features.trends && ( )} + {features.suggestions && ( + + )} diff --git a/src/pages/search-page.tsx b/src/pages/search-page.tsx index 338076d42..0da0ffb01 100644 --- a/src/pages/search-page.tsx +++ b/src/pages/search-page.tsx @@ -39,7 +39,7 @@ const SearchPage: React.FC = ({ children }) => { )} - {me && features.suggestions && ( + {features.suggestions && ( )} diff --git a/src/pages/status-page.tsx b/src/pages/status-page.tsx index cc184e9de..aacee8175 100644 --- a/src/pages/status-page.tsx +++ b/src/pages/status-page.tsx @@ -36,7 +36,7 @@ const StatusPage: React.FC = ({ children }) => { {features.trends && ( )} - {me && features.suggestions && ( + {features.suggestions && ( )}