mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
Merge pull request #31 from aaronpo97/comments-bug-fix
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}
|
pageSize={PAGE_SIZE}
|
||||||
setSize={setSize}
|
setSize={setSize}
|
||||||
size={size}
|
size={size}
|
||||||
|
mutate={mutate}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ const BreweryCommentsSection: FC<BreweryBeerSectionProps> = ({ breweryPost }) =>
|
|||||||
setSize={setSize}
|
setSize={setSize}
|
||||||
size={size}
|
size={size}
|
||||||
commentSectionRef={commentSectionRef}
|
commentSectionRef={commentSectionRef}
|
||||||
|
mutate={mutate}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { FC, MutableRefObject } from 'react';
|
import { FC, MutableRefObject } from 'react';
|
||||||
import { FaArrowUp } from 'react-icons/fa';
|
import { FaArrowUp } from 'react-icons/fa';
|
||||||
import { mutate } from 'swr';
|
|
||||||
import { useInView } from 'react-intersection-observer';
|
import { useInView } from 'react-intersection-observer';
|
||||||
|
|
||||||
import useBeerPostComments from '@/hooks/useBeerPostComments';
|
import useBeerPostComments from '@/hooks/useBeerPostComments';
|
||||||
@@ -25,6 +25,9 @@ interface CommentsComponentProps {
|
|||||||
isLoadingMore: ReturnType<
|
isLoadingMore: ReturnType<
|
||||||
typeof useBeerPostComments | typeof useBreweryPostComments
|
typeof useBeerPostComments | typeof useBreweryPostComments
|
||||||
>['isLoadingMore'];
|
>['isLoadingMore'];
|
||||||
|
mutate: ReturnType<
|
||||||
|
typeof useBeerPostComments | typeof useBreweryPostComments
|
||||||
|
>['mutate'];
|
||||||
}
|
}
|
||||||
|
|
||||||
const CommentsComponent: FC<CommentsComponentProps> = ({
|
const CommentsComponent: FC<CommentsComponentProps> = ({
|
||||||
@@ -35,6 +38,7 @@ const CommentsComponent: FC<CommentsComponentProps> = ({
|
|||||||
pageSize,
|
pageSize,
|
||||||
setSize,
|
setSize,
|
||||||
size,
|
size,
|
||||||
|
mutate,
|
||||||
}) => {
|
}) => {
|
||||||
const { ref: penultimateCommentRef } = useInView({
|
const { ref: penultimateCommentRef } = useInView({
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user