From 3ac9a418e6000eaff4abc99d6e5ec3b5d49bc913 Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Thu, 20 May 2021 22:19:15 -0400 Subject: [PATCH] Defer ChooseType teams list query until component visible --- components/collections/ChooseType.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/collections/ChooseType.vue b/components/collections/ChooseType.vue index 01745b9f2..acc8b565d 100644 --- a/components/collections/ChooseType.vue +++ b/components/collections/ChooseType.vue @@ -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)