mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 10:42:08 +00:00
Fix bug where comments would not update when edited
This commit is contained in:
@@ -62,6 +62,7 @@ const BeerPostCommentsSection: FC<BeerPostCommentsSectionProps> = ({ beerPost })
|
||||
pageSize={PAGE_SIZE}
|
||||
setSize={setSize}
|
||||
size={size}
|
||||
mutate={mutate}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -134,6 +134,7 @@ const BreweryCommentsSection: FC<BreweryBeerSectionProps> = ({ breweryPost }) =>
|
||||
setSize={setSize}
|
||||
size={size}
|
||||
commentSectionRef={commentSectionRef}
|
||||
mutate={mutate}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { FC, MutableRefObject } from 'react';
|
||||
import { FaArrowUp } from 'react-icons/fa';
|
||||
import { mutate } from 'swr';
|
||||
|
||||
import { useInView } from 'react-intersection-observer';
|
||||
|
||||
import useBeerPostComments from '@/hooks/useBeerPostComments';
|
||||
@@ -25,6 +25,9 @@ interface CommentsComponentProps {
|
||||
isLoadingMore: ReturnType<
|
||||
typeof useBeerPostComments | typeof useBreweryPostComments
|
||||
>['isLoadingMore'];
|
||||
mutate: ReturnType<
|
||||
typeof useBeerPostComments | typeof useBreweryPostComments
|
||||
>['mutate'];
|
||||
}
|
||||
|
||||
const CommentsComponent: FC<CommentsComponentProps> = ({
|
||||
@@ -35,6 +38,7 @@ const CommentsComponent: FC<CommentsComponentProps> = ({
|
||||
pageSize,
|
||||
setSize,
|
||||
size,
|
||||
mutate,
|
||||
}) => {
|
||||
const { ref: penultimateCommentRef } = useInView({
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user