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

Add refresh method to calendar component

parent 91ee5237
No related branches found
No related tags found
1 merge request!1304Refactor calendar overview in more different components
Pipeline #144486 failed
......@@ -356,6 +356,17 @@ export default {
},
});
},
refresh() {
// Stop polling the query with old variables
this.$apollo.queries.calendar.stopPolling();
clearInterval(this.fetchMoreInterval);
this.fetchMoreCalendarEvents(this.queryVariables.start, this.queryVariables.end);
this.fetchMoreInterval = setInterval(() => {
this.fetchMoreCalendarEvents(this.queryVariables.start, this.queryVariables.end);
}, 30000);
},
fetch() {
this.title = this.$refs.calendar.title;
......@@ -372,15 +383,7 @@ export default {
this.$apollo.queries.calendar.startPolling(30000);
this.fetchedDateRanges.push({ start: extendedStart, end: extendedEnd });
} else if (!this.isFullyContained(extendedStart, extendedEnd)) {
// Stop polling the query with old variables
this.$apollo.queries.calendar.stopPolling();
clearInterval(this.fetchMoreInterval);
this.fetchMoreCalendarEvents(extendedStart, extendedEnd);
this.fetchMoreInterval = setInterval(() => {
this.fetchMoreCalendarEvents(extendedStart, extendedEnd);
}, 30000);
this.refresh();
this.fetchedDateRanges.push({ start: extendedStart, end: extendedEnd });
} else {
......
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