Use thread id in removeNewCommentRangeEffect (#23205)

GitOrigin-RevId: 6082f5e6d6f548eff43da657526097118a2d3c11
This commit is contained in:
Alf Eaton
2025-02-03 09:04:48 +00:00
committed by Copybot
parent a6bfbad5bd
commit 5e491cc0c0
3 changed files with 16 additions and 18 deletions
@@ -19,7 +19,7 @@ import { v4 as uuid } from 'uuid'
export const addNewCommentRangeEffect = StateEffect.define<Range<Decoration>>()
export const removeNewCommentRangeEffect = StateEffect.define<Decoration>()
export const removeNewCommentRangeEffect = StateEffect.define<string>()
export const textSelectedEffect = StateEffect.define<null>()
@@ -103,11 +103,10 @@ export const reviewTooltipStateField = StateField.define<{
for (const effect of tr.effects) {
if (effect.is(removeNewCommentRangeEffect)) {
const rangeToRemove = effect.value
const threadId = effect.value
addCommentRanges = addCommentRanges.update({
// eslint-disable-next-line no-unused-vars
filter: (from, to, value) => {
return value.spec.id !== rangeToRemove.spec.id
filter: (_from, _to, value) => {
return value.spec.id !== threadId
},
})
}