Replace refresh with refetch

This commit is contained in:
Douglas Barone 2020-12-16 09:34:38 -04:00
parent 37d7f94141
commit b965fdf5c9
2 changed files with 18 additions and 5 deletions

View File

@ -89,7 +89,7 @@ export default {
}
`,
result(data) {
this.$apollo.queries.stats.refresh()
this.$apollo.queries.stats.refetch()
}
}
},

View File

@ -30,10 +30,23 @@
</v-toolbar>
<v-container fluid class="mb-12">
<div v-if="stats" class="text-center my-4">
<v-chip color="primary" class="mr-2" dark>
<v-chip color="primary" class="mr-1" dark>
{{ stats.onlineUsers }}
</v-chip>
usuários online.
<v-scale-transition>
<span v-if="search">
<v-chip color="primary" class="ml-2 mr-1" dark>
{{
userPresence.filter(
presence => presence.wifiDevices[0].isOnline
).length
}}
/ {{ userPresence.length }}
</v-chip>
na sua pesquisa.
</span>
</v-scale-transition>
</div>
<UserPresenceStatusList
@ -155,7 +168,7 @@ export default {
`,
variables() {
return {
search: this.search
search: this.search?.trim()
}
},
debounce: 250
@ -177,8 +190,8 @@ export default {
}
`,
result() {
this.$apollo.queries.userPresence.refresh()
this.$apollo.queries.stats.refresh()
this.$apollo.queries.userPresence.refetch()
this.$apollo.queries.stats.refetch()
}
}
}