Use Intersection component to fetch team list on visibility

This commit is contained in:
Andrew Bastin
2021-05-11 23:39:23 -04:00
parent 853acfda2c
commit dd3b51d0b7

View File

@@ -6,6 +6,7 @@
<ul>
<li>
<span class="select-wrapper">
<SmartIntersection @intersecting="onTeamSelectIntersect">
<select
type="text"
id="team"
@@ -20,6 +21,7 @@
{{ team.name }}
</option>
</select>
</SmartIntersection>
</span>
</li>
</ul>
@@ -46,10 +48,14 @@ export default {
}
}
`,
pollInterval: 5000,
pollInterval: 10000,
},
},
methods: {
onTeamSelectIntersect() {
// Load team data as soon as intersection
this.$apollo.queries.myTeams.refetch()
},
updateCollectionsType(tabID) {
this.$emit("update-collection-type", tabID)
},