Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <louis@chmn.me>
  • Loading branch information
artonge committed Nov 15, 2023
1 parent 0e654e1 commit 4e8148c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/mixins/FetchFilesMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export default {
],

data() {
const dateTimeUpperBound = moment()
const dateTimeLowerBound = moment(dateTimeUpperBound).subtract(4, 'months')
const dateTimeUpperBound = undefined
const dateTimeLowerBound = moment().subtract(4, 'months')

return {
errorFetchingFiles: null,
Expand Down Expand Up @@ -96,13 +96,15 @@ export default {
this.firstResultOffset += fetchedFiles.length
} else if (fetchedFiles.length === 0 && this.firstResultOffset === 0) {
// If we tried a new window and it is empty
if (this.dateTimeUpperBound === undefined) {
if (this.dateTimeUpperBound === undefined && this.dateTimeLowerBound === undefined) {
// if upper bound has been cleared, then we are done fetching files.
this.doneFetchingFiles = true
} else if (this.dateTimeLowerBound === undefined) {
// else if lower bound has been cleared, then we clear upper bound
// this will allow the server to return all files with either empty or above than now original date time
this.dateTimeUpperBound = undefined
} else if (this.dateTimeUpperBound === undefined) {
this.dateTimeUpperBound = this.dateTimeLowerBound
} else if (this.timeWindowSteps === 64) {
// else if we reach 64 months, we clear the lower bound.
this.dateTimeUpperBound = this.dateTimeLowerBound
Expand Down

0 comments on commit 4e8148c

Please sign in to comment.