-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
Updated ActivityPub to use dynamic topics and recommendations from API #25646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5f22581
4431871
6ace170
d6d2657
5731e6e
95671ed
5fa8983
1e95da5
a0caf6a
e307ec1
086cb83
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -16,7 +16,7 @@ import readerCover from '@assets/images/onboarding/cover-reader.png'; | |||||||||||||
| import tangleAvatar from '@assets/images/onboarding/avatar-tangle.png'; | ||||||||||||||
| import tangleCover from '@assets/images/onboarding/cover-tangle.png'; | ||||||||||||||
| import {Avatar, AvatarFallback, AvatarImage, Button, H1, LucideIcon, Separator} from '@tryghost/shade'; | ||||||||||||||
| import {useAccountForUser} from '@src/hooks/use-activity-pub-queries'; | ||||||||||||||
| import {useAccountForUser, useTopicsForUser} from '@src/hooks/use-activity-pub-queries'; | ||||||||||||||
| import {useNavigateWithBasePath} from '@src/hooks/use-navigate-with-base-path'; | ||||||||||||||
| import {useOnboardingStatus} from './Onboarding'; | ||||||||||||||
|
|
||||||||||||||
|
|
@@ -302,6 +302,9 @@ const Step3: React.FC = () => { | |||||||||||||
| const [isHovering, setIsHovering] = useState(false); | ||||||||||||||
| const {setOnboarded} = useOnboardingStatus(); | ||||||||||||||
| const navigate = useNavigateWithBasePath(); | ||||||||||||||
| const {topicsQuery} = useTopicsForUser(); | ||||||||||||||
| const {data: topicsData} = topicsQuery; | ||||||||||||||
| const hasTopics = topicsData && topicsData.topics.length > 0; | ||||||||||||||
|
Comment on lines
+305
to
+307
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent loading state handling compared to Sidebar. The const {topicsQuery} = useTopicsForUser();
-const {data: topicsData} = topicsQuery;
-const hasTopics = topicsData && topicsData.topics.length > 0;
+const {data: topicsData, isLoading} = topicsQuery;
+const hasTopics = !isLoading && topicsData && topicsData.topics.length > 0;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
|
|
||||||||||||||
| useEffect(() => { | ||||||||||||||
| if (isHovering) { | ||||||||||||||
|
|
@@ -317,7 +320,7 @@ const Step3: React.FC = () => { | |||||||||||||
|
|
||||||||||||||
| const handleComplete = async () => { | ||||||||||||||
| await setOnboarded(true); | ||||||||||||||
| navigate('/explore'); | ||||||||||||||
| navigate(hasTopics ? '/explore' : '/'); | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Race condition in onboarding navigation when topics query is loadingThe |
||||||||||||||
| }; | ||||||||||||||
|
|
||||||||||||||
| return ( | ||||||||||||||
|
|
||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.