Ensure that tracked changes are highlighted in read-only mode (#18036)

GitOrigin-RevId: 5010e1649d8f15014f9c8ef578073be7c6545aa4
This commit is contained in:
Alf Eaton 2024-04-23 09:30:53 +01:00 committed by Copybot
parent 98cefaa5bd
commit 905c9b2c28

View file

@ -428,17 +428,15 @@ function useReviewPanelState(): ReviewPanel.ReviewPanelState {
let localResolvedThreadIds = resolvedThreadIds let localResolvedThreadIds = resolvedThreadIds
if (!isRestrictedTokenMember) { if (!isRestrictedTokenMember && rangesTracker.comments.length > 0) {
if (rangesTracker.comments.length > 0) { const threadsLoadResult = await ensureThreadsAreLoaded()
const threadsLoadResult = await ensureThreadsAreLoaded() if (threadsLoadResult?.resolvedThreadIds) {
if (threadsLoadResult?.resolvedThreadIds) { localResolvedThreadIds = threadsLoadResult.resolvedThreadIds
localResolvedThreadIds = threadsLoadResult.resolvedThreadIds
}
} else if (loadingThreads) {
// ensure that tracked changes are highlighted even if no comments are loaded
setLoadingThreads(false)
dispatchReviewPanelEvent('loaded_threads')
} }
} else if (loadingThreads) {
// ensure that tracked changes are highlighted even if no comments are loaded
setLoadingThreads(false)
dispatchReviewPanelEvent('loaded_threads')
} }
if (!loadingThreadsInProgressRef.current) { if (!loadingThreadsInProgressRef.current) {