mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #14831 from overleaf/jdt-hist-free-label
allow labels on history for free user versions over 24 hrs GitOrigin-RevId: 8a71f999ad0bb22a5dc8155f14a39a4b625624ba
This commit is contained in:
parent
08d8b40934
commit
6929984e04
2 changed files with 8 additions and 5 deletions
|
@ -140,7 +140,8 @@ function AllHistoryList() {
|
|||
const showDivider = Boolean(update.meta.first_in_day && index > 0)
|
||||
const faded =
|
||||
updatesInfo.freeHistoryLimitHit &&
|
||||
index === visibleUpdates.length - 1
|
||||
index === visibleUpdates.length - 1 &&
|
||||
visibleUpdates.length > 1
|
||||
const selectable =
|
||||
!faded &&
|
||||
(selection.comparing ||
|
||||
|
|
|
@ -132,15 +132,17 @@ function useHistory() {
|
|||
|
||||
previousUpdate = update
|
||||
|
||||
// the free tier cutoff is 24 hours, so show one extra update
|
||||
// after which will become the fade teaser above the paywall
|
||||
if (
|
||||
!userHasFullFeature &&
|
||||
visibleUpdateCount === null &&
|
||||
update.meta.end_ts < timestamp24hoursAgo
|
||||
) {
|
||||
// Make sure that we show at least one entry (to allow labelling), and
|
||||
// load one extra update that is displayed but faded out above the
|
||||
// paywall
|
||||
visibleUpdateCount = index + 1
|
||||
// Make sure that we show at least one entry fully (to allow labelling), and one extra for fading
|
||||
// Since the index for the first free tier cutoff will be at 0 if all versions were updated the day before (all version in the past),
|
||||
// we need to +2 instead of +1. this gives us one which is selected and one which is faded
|
||||
visibleUpdateCount = index > 0 ? index + 1 : 2
|
||||
freeHistoryLimitHit = true
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue