Skip to content

Commit a30948b

Browse files
authored
fix(fe): make changelog non blocking resource (#3308)
* docs: use correct port in examples * fix(fe): remove stickiness of headers * fix(fe): make changelog non blocking resource
1 parent 6123ddc commit a30948b

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

frontend/src/app/changelog.tsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { faSparkle, Icon } from "@rivet-gg/icons";
2-
import { useSuspenseQuery } from "@tanstack/react-query";
2+
import { useQuery } from "@tanstack/react-query";
33
import { useLocalStorage } from "usehooks-ts";
44
import {
55
Avatar,
@@ -113,13 +113,27 @@ interface ChangelogProps {
113113
}
114114

115115
export function Changelog({ className, children, ...props }: ChangelogProps) {
116-
const { data } = useSuspenseQuery(changelogQueryOptions());
116+
const { data, isLoading, isError } = useQuery(changelogQueryOptions());
117117

118118
const [lastChangelog, setLast] = useLocalStorage<string | null>(
119119
"rivet-lastchangelog",
120120
null,
121121
);
122122

123+
if (isLoading || isError || !data || data.length === 0) {
124+
return (
125+
<Slot
126+
{...props}
127+
className={cn(
128+
"relative [&_[data-changelog-ping]]:hidden",
129+
className,
130+
)}
131+
>
132+
{children}
133+
</Slot>
134+
);
135+
}
136+
123137
const hasNewChangelog = !lastChangelog
124138
? data.length > 0
125139
: data.some(

0 commit comments

Comments
 (0)