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