Skip to content

Commit 5d5c759

Browse files
committed
fix: query
Signed-off-by: Innei <[email protected]>
1 parent 032bf39 commit 5d5c759

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

src/components/widgets/comment/CommentBox.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const createInitialValue = () => ({
1919
text: atom(''),
2020
refId: atom(''),
2121
})
22+
2223
const CommentBoxContext = createContext(createInitialValue())
2324

2425
const CommentBoxProvider = (props: PropsWithChildren) => {
@@ -33,6 +34,7 @@ const enum CommentBoxMode {
3334
'legacy',
3435
'with-auth',
3536
}
37+
3638
export const CommentBox: FC<CommentBaseProps> = (props) => {
3739
const [mode, setMode] = useState<CommentBoxMode>(CommentBoxMode['with-auth'])
3840
return (
@@ -75,6 +77,7 @@ const CommentBoxWithAuth = () => {
7577
</AutoResizeHeight>
7678
)
7779
}
80+
7881
const CommentAuthedInputSkeleton = () => {
7982
const color = 'bg-gray-200/50 dark:bg-zinc-800/50'
8083
return (
@@ -89,6 +92,7 @@ const CommentAuthedInputSkeleton = () => {
8992
</div>
9093
)
9194
}
95+
9296
const CommentAuthedInput = () => {
9397
const { user } = useUser()
9498
if (!user) return <CommentAuthedInputSkeleton />

src/providers/root/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ export function Providers({ children }: PropsWithChildren) {
2525
return (
2626
<>
2727
<SocketContainer />
28+
<ModalStackProvider key="modalStackProvider" />
2829
<ProviderComposer contexts={contexts}>
2930
{children}
3031
<EventProvider key="viewportProvider" />
3132
<SentryProvider key="SentryProvider" />
3233
<PageScrollInfoProvider key="PageScrollInfoProvider" />
3334
<DebugProvider key="debugProvider" />
34-
<ModalStackProvider key="modalStackProvider" />
3535
</ProviderComposer>
3636
</>
3737
)

src/providers/root/react-query-provider.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ const persister = {
2727
export const queryClient = new QueryClient({
2828
defaultOptions: {
2929
queries: {
30-
cacheTime: 1000 * 60 * 5, // 5 minutes
30+
staleTime: 1000 * 60 * 5, // 5 minutes
31+
3132
refetchInterval: 1000 * 60 * 5, // 5 minutes
3233
refetchOnWindowFocus: false,
3334
refetchIntervalInBackground: false,

src/utils/query-client.server.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { cache } from 'react'
44
const queryClient = new QueryClient({
55
defaultOptions: {
66
queries: {
7-
// cacheTime: 0,
87
staleTime: 1000 * 3,
8+
cacheTime: 1000 * 3,
99
},
1010
},
1111
})

0 commit comments

Comments
 (0)