Skip to content
Snippets Groups Projects
Commit 35952d71 authored by Hangzhi Yu's avatar Hangzhi Yu
Browse files

Add polling to calendar

parent fd5c9af7
No related branches found
No related tags found
1 merge request!1304Refactor calendar overview in more different components
Pipeline #140458 failed
......@@ -243,8 +243,12 @@ export default {
this.$apollo.queries.calendar.setVariables(this.queryVariables);
this.$apollo.queries.calendar.skip = false;
this.$apollo.queries.calendar.startPolling(30000);
this.fetchedDateRange = { start: extendedStart, end: extendedEnd };
} else if (olderStart || youngerEnd) {
// Stop polling the query with old variables
this.$apollo.queries.calendar.stopPolling();
// Define newly fetched date range
let newStart = olderStart ? extendedStart : this.fetchedDateRange.start;
let newEnd = youngerEnd ? extendedEnd : this.fetchedDateRange.end;
......@@ -281,6 +285,14 @@ export default {
});
this.fetchedDateRange = { start: newStart, end: newEnd };
// Restart polling the query with newly set variables
this.$apollo.queries.calendar.setVariables(this.queryVariables);
this.$apollo.queries.calendar.startPolling(30000);
this.fetchedDateRange = {
start: this.queryVariables.start,
end: this.queryVariables.end
};
}
},
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment