Skip to content

Commit

Permalink
fix: change timeline type refetch
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Jul 6, 2023
1 parent 7cf8433 commit 6c995d1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/app/timeline/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default function TimelinePage() {
queryKey: ['timeline'],
enabled: false,
})
const { data } = useQuery<TimelineData>({
const { data, refetch } = useQuery<TimelineData>({
queryKey: ['timeline', nextType, year],
initialData,
queryFn: async ({ queryKey }) => {
Expand All @@ -100,6 +100,10 @@ export default function TimelinePage() {
},
})

useEffect(() => {
refetch()
}, [nextType])

useJumpTo()

if (!data) return null
Expand Down
2 changes: 1 addition & 1 deletion src/providers/root/modal-stack-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const initialStyle: Target = {
const modalTransition: Transition = {
...microReboundPreset,
}
export const Modal: Component<{
const Modal: Component<{
item: ModalProps & { id: string }
index: number
}> = memo(function Modal({ item, index }) {
Expand Down
1 change: 1 addition & 0 deletions src/providers/root/react-query-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const ReactQueryProvider = ({ children }: PropsWithChildren) => {
persistOptions={
useRef<Omit<PersistQueryClientOptions, 'queryClient'>>({
persister,
maxAge: 1000 * 60 * 60 * 24 * 7, // 1 week
dehydrateOptions: {
shouldDehydrateQuery: (query) => {
const queryIsReadyForPersistance =
Expand Down

1 comment on commit 6c995d1

@vercel
Copy link

@vercel vercel bot commented on 6c995d1 Jul 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

shiro – ./

shiro-innei.vercel.app
springtide.vercel.app
shiro-git-main-innei.vercel.app
innei.in

Please sign in to comment.