Use Intersection component to fetch team list on visibility
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<span class="select-wrapper">
|
<span class="select-wrapper">
|
||||||
|
<SmartIntersection @intersecting="onTeamSelectIntersect">
|
||||||
<select
|
<select
|
||||||
type="text"
|
type="text"
|
||||||
id="team"
|
id="team"
|
||||||
@@ -20,6 +21,7 @@
|
|||||||
{{ team.name }}
|
{{ team.name }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
|
</SmartIntersection>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -46,10 +48,14 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
pollInterval: 5000,
|
pollInterval: 10000,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
onTeamSelectIntersect() {
|
||||||
|
// Load team data as soon as intersection
|
||||||
|
this.$apollo.queries.myTeams.refetch()
|
||||||
|
},
|
||||||
updateCollectionsType(tabID) {
|
updateCollectionsType(tabID) {
|
||||||
this.$emit("update-collection-type", tabID)
|
this.$emit("update-collection-type", tabID)
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user