Skip to content

Commit fcdc3ec

Browse files
authored
fix(updates): show skeleton while release notes load (#3038)
1 parent 666c1db commit fcdc3ec

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

packages/ui/src/features/updates/UpdateAvailableModal.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { X } from "@phosphor-icons/react";
22
import { useHostTRPC } from "@posthog/host-router/react";
3-
import { MarkdownRenderer } from "@posthog/ui/features/editor/components/MarkdownRenderer";
43
import { ReleaseNotesSections } from "@posthog/ui/features/updates/ReleaseNotesSections";
54
import { parseReleaseNotes } from "@posthog/ui/features/updates/releaseNotes";
65
import { useUpdateModalStore } from "@posthog/ui/features/updates/updateModalStore";
@@ -63,7 +62,7 @@ export function UpdateAvailableModal() {
6362
const downloadMutation = useMutation(
6463
hostTRPC.updates.download.mutationOptions(),
6564
);
66-
const { data: releasesData, isLoading: isLoadingReleases } = useQuery({
65+
const { data: releasesData, isPending: isPendingReleases } = useQuery({
6766
...hostTRPC.githubReleases.list.queryOptions(),
6867
enabled: isOpen,
6968
});
@@ -115,7 +114,7 @@ export function UpdateAvailableModal() {
115114
</Dialog.Close>
116115
</Flex>
117116

118-
{hasParsedNotes || rawNotes || isLoadingReleases ? (
117+
{hasParsedNotes || isPendingReleases ? (
119118
<Flex direction="column" gap="2">
120119
<Text
121120
size="1"
@@ -125,18 +124,14 @@ export function UpdateAvailableModal() {
125124
>
126125
Release notes
127126
</Text>
128-
{hasParsedNotes || rawNotes ? (
127+
{hasParsedNotes && parsedNotes ? (
129128
<ScrollArea
130129
type="auto"
131130
scrollbars="vertical"
132131
style={{ maxHeight: 240 }}
133132
>
134133
<div className="pr-3">
135-
{hasParsedNotes && parsedNotes ? (
136-
<ReleaseNotesSections notes={parsedNotes} />
137-
) : rawNotes ? (
138-
<MarkdownRenderer content={rawNotes} />
139-
) : null}
134+
<ReleaseNotesSections notes={parsedNotes} />
140135
</div>
141136
</ScrollArea>
142137
) : (

0 commit comments

Comments
 (0)