mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-16 03:46:21 +00:00
Merge pull request #2999 from overleaf/as-em-fix-double-updates-load
Fix history loading updates twice on scroll GitOrigin-RevId: 964863c7357eef36b2833c7b1e8ebaa07020fb2c
This commit is contained in:
parent
c200511f86
commit
5b0d5447da
2 changed files with 5 additions and 0 deletions
|
@ -130,6 +130,7 @@ export default (HistoryManager = (function() {
|
|||
updates: [],
|
||||
viewMode: this._getViewModeUserPref(),
|
||||
nextBeforeTimestamp: null,
|
||||
loading: false,
|
||||
atEnd: false,
|
||||
userHasFullFeature: undefined,
|
||||
freeHistoryLimitHit: false,
|
||||
|
@ -618,9 +619,11 @@ export default (HistoryManager = (function() {
|
|||
requests.labels = this.ide.$http.get(labelsURL)
|
||||
}
|
||||
|
||||
this.$scope.history.loading = true
|
||||
return this.ide.$q
|
||||
.all(requests)
|
||||
.then(response => {
|
||||
this.$scope.history.loading = false
|
||||
const updatesData = response.updates.data
|
||||
let lastUpdateToV = null
|
||||
|
||||
|
@ -648,6 +651,7 @@ export default (HistoryManager = (function() {
|
|||
}
|
||||
})
|
||||
.catch(error => {
|
||||
this.$scope.history.loading = false
|
||||
const { status, statusText } = error
|
||||
this.$scope.history.error = { status, statusText }
|
||||
this.$scope.history.atEnd = true
|
||||
|
|
|
@ -19,6 +19,7 @@ export default describe('HistoryV2Manager', function() {
|
|||
updates: [],
|
||||
viewMode: 'point_in_time',
|
||||
nextBeforeTimestamp: null,
|
||||
loading: false,
|
||||
atEnd: false,
|
||||
userHasFullFeature: undefined,
|
||||
freeHistoryLimitHit: false,
|
||||
|
|
Loading…
Add table
Reference in a new issue