Defer ChooseType teams list query until component visible

This commit is contained in:
Andrew Bastin
2021-05-20 22:19:15 -04:00
parent c98de5988e
commit 3ac9a418e6

View File

@@ -61,6 +61,11 @@ export default {
doc: Boolean,
show: Boolean,
},
data() {
return {
skipTeamsFetching: true
}
},
subscriptions() {
return {
currentUser: currentUserInfo$,
@@ -78,12 +83,16 @@ export default {
}
`,
pollInterval: 10000,
skip() {
return this.skipTeamsFetching
}
},
},
methods: {
onTeamSelectIntersect() {
// Load team data as soon as intersection
this.$apollo.queries.myTeams.refetch()
this.skipTeamsFetching = false
},
updateCollectionsType(tabID) {
this.$emit("update-collection-type", tabID)