|
@@ -147,7 +147,7 @@ const ReviewPanelCurrentFile: FC = () => {
|
|
|
|
|
|
|
|
const positionsRef = useRef<Map<string, number>>(new Map())
|
|
const positionsRef = useRef<Map<string, number>>(new Map())
|
|
|
|
|
|
|
|
- const addCommentRanges = state.field(addCommentStateField).ranges
|
|
|
|
|
|
|
+ const addCommentRanges = state.field(addCommentStateField, false)?.ranges
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
if (aggregatedRanges) {
|
|
if (aggregatedRanges) {
|
|
@@ -178,6 +178,10 @@ const ReviewPanelCurrentFile: FC = () => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (!addCommentRanges) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
const cursor = addCommentRanges.iter()
|
|
const cursor = addCommentRanges.iter()
|
|
|
|
|
|
|
|
while (cursor.value) {
|
|
while (cursor.value) {
|
|
@@ -212,6 +216,10 @@ const ReviewPanelCurrentFile: FC = () => {
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
const addCommentEntries = useMemo(() => {
|
|
const addCommentEntries = useMemo(() => {
|
|
|
|
|
+ if (!addCommentRanges) {
|
|
|
|
|
+ return []
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
const cursor = addCommentRanges.iter()
|
|
const cursor = addCommentRanges.iter()
|
|
|
|
|
|
|
|
const entries = []
|
|
const entries = []
|