mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
92ade70601
[web] Fix history entries and labels selection issues GitOrigin-RevId: 73b14ba15ab4f0d9ff5946b1159ae7d5912582dd
26 lines
592 B
TypeScript
26 lines
592 B
TypeScript
import { UpdateRange } from '../services/types/update'
|
|
|
|
export const computeUpdateRange = (
|
|
updateRange: UpdateRange,
|
|
fromV: number,
|
|
toV: number,
|
|
updateMetaEndTimestamp: number
|
|
) => {
|
|
const fromVersion = Math.min(fromV, updateRange.fromV)
|
|
const toVersion = Math.max(toV, updateRange.toV)
|
|
const fromVTimestamp = Math.min(
|
|
updateMetaEndTimestamp,
|
|
updateRange.fromVTimestamp
|
|
)
|
|
const toVTimestamp = Math.max(
|
|
updateMetaEndTimestamp,
|
|
updateRange.toVTimestamp
|
|
)
|
|
|
|
return {
|
|
fromV: fromVersion,
|
|
toV: toVersion,
|
|
fromVTimestamp,
|
|
toVTimestamp,
|
|
}
|
|
}
|