Merge pull request #20776 from overleaf/dp-resolve-lint

Provide empty decoration set to useMoreComments when addCommentRanges is undefined

GitOrigin-RevId: 40b7ae41ef783586d4304f2896397d8e84628e18
This commit is contained in:
David 2024-10-02 13:19:12 +01:00 committed by Copybot
parent 56d396a6cf
commit 4c334b4b45

View file

@ -31,6 +31,7 @@ import { hasActiveRange } from '@/features/review-panel-new/utils/has-active-ran
import { addCommentStateField } from '@/features/source-editor/extensions/add-comment' import { addCommentStateField } from '@/features/source-editor/extensions/add-comment'
import ReviewPanelMoreCommentsButton from './review-panel-more-comments-button' import ReviewPanelMoreCommentsButton from './review-panel-more-comments-button'
import useMoreCommments from '../hooks/use-more-comments' import useMoreCommments from '../hooks/use-more-comments'
import { Decoration } from '@codemirror/view'
type AggregatedRanges = { type AggregatedRanges = {
changes: Change<EditOperation>[] changes: Change<EditOperation>[]
@ -216,7 +217,7 @@ const ReviewPanelCurrentFile: FC = () => {
} = useMoreCommments( } = useMoreCommments(
aggregatedRanges?.changes ?? [], aggregatedRanges?.changes ?? [],
aggregatedRanges?.comments ?? [], aggregatedRanges?.comments ?? [],
addCommentRanges addCommentRanges ?? Decoration.none
) )
const updatePositions = useCallback(() => { const updatePositions = useCallback(() => {