mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-31 04:41:32 +02:00
Rename `review-panel-new` to simply `review-panel` GitOrigin-RevId: 7aad0406bce60602d272bdfae7a124ed4246bd1c
27 lines
611 B
TypeScript
27 lines
611 B
TypeScript
import { Ranges } from '@/features/review-panel/context/ranges-context'
|
|
import { Threads } from '@/features/review-panel/context/threads-context'
|
|
|
|
export const hasActiveRange = (
|
|
ranges: Ranges | undefined,
|
|
threads: Threads | undefined
|
|
): boolean | undefined => {
|
|
if (!ranges || !threads) {
|
|
// data isn't loaded yet
|
|
return undefined
|
|
}
|
|
|
|
if (ranges.changes.length > 0) {
|
|
// at least one tracked change
|
|
return true
|
|
}
|
|
|
|
for (const comment of ranges.comments) {
|
|
const thread = threads[comment.op.t]
|
|
if (thread && !thread.resolved) {
|
|
return true
|
|
}
|
|
}
|
|
|
|
return false
|
|
}
|