Skip to content

Commit e307ec1

Browse files
Fixed navigation fallbacks when topics are unavailable
1 parent a0caf6a commit e307ec1

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

apps/activitypub/src/components/layout/Onboarding/Step3.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import readerCover from '@assets/images/onboarding/cover-reader.png';
1616
import tangleAvatar from '@assets/images/onboarding/avatar-tangle.png';
1717
import tangleCover from '@assets/images/onboarding/cover-tangle.png';
1818
import {Avatar, AvatarFallback, AvatarImage, Button, H1, LucideIcon, Separator} from '@tryghost/shade';
19-
import {useAccountForUser} from '@src/hooks/use-activity-pub-queries';
19+
import {useAccountForUser, useTopicsForUser} from '@src/hooks/use-activity-pub-queries';
2020
import {useNavigateWithBasePath} from '@src/hooks/use-navigate-with-base-path';
2121
import {useOnboardingStatus} from './Onboarding';
2222

@@ -302,6 +302,9 @@ const Step3: React.FC = () => {
302302
const [isHovering, setIsHovering] = useState(false);
303303
const {setOnboarded} = useOnboardingStatus();
304304
const navigate = useNavigateWithBasePath();
305+
const {topicsQuery} = useTopicsForUser();
306+
const {data: topicsData} = topicsQuery;
307+
const hasTopics = topicsData && topicsData.topics.length > 0;
305308

306309
useEffect(() => {
307310
if (isHovering) {
@@ -317,7 +320,7 @@ const Step3: React.FC = () => {
317320

318321
const handleComplete = async () => {
319322
await setOnboarded(true);
320-
navigate('/explore');
323+
navigate(hasTopics ? '/explore' : '/');
321324
};
322325

323326
return (

apps/activitypub/src/views/Inbox/components/InboxList.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,17 @@ const InboxList:React.FC<InboxListProps> = ({
139139
<div className='mt-[24vh]'>
140140
<EmptyIndicator
141141
actions={
142-
<Button onClick={() => navigate('/explore')}>
143-
Find accounts to follow &rarr;
144-
</Button>
142+
hasTopics ? (
143+
<Button onClick={() => navigate('/explore')}>
144+
Find accounts to follow &rarr;
145+
</Button>
146+
) : (
147+
<Button asChild>
148+
<a href="https://explore.ghost.org/social-web" rel="noopener noreferrer" target="_blank">
149+
Find accounts to follow &rarr;
150+
</a>
151+
</Button>
152+
)
145153
}
146154
description="Start following publishers to see their long-form posts here."
147155
title="Your Reader is empty"

0 commit comments

Comments
 (0)