fix: issue with team members list not being up to date

This commit is contained in:
Andrew Bastin
2022-02-04 23:00:01 +05:30
parent bd268e67ae
commit b974bcc442
2 changed files with 29 additions and 8 deletions

View File

@@ -242,7 +242,6 @@ watch(
watch(
() => props.editingTeamID,
(teamID: string) => {
console.log("teamID", teamID)
teamDetails.execute({ teamID })
}
)
@@ -252,6 +251,7 @@ const teamDetails = useGQLQuery<GetTeamQuery, GetTeamQueryVariables, "">({
variables: {
teamID: props.editingTeamID,
},
pollDuration: 10000,
defer: true,
updateSubs: computed(() => {
if (props.editingTeamID) {
@@ -282,6 +282,17 @@ const teamDetails = useGQLQuery<GetTeamQuery, GetTeamQueryVariables, "">({
}),
})
watch(
() => props.show,
(show) => {
if (!show) {
teamDetails.pause()
} else {
teamDetails.unpause()
}
}
)
const roleUpdates = ref<
{
userID: string
@@ -294,8 +305,6 @@ watch(
() => {
if (teamDetails.loading) return
console.log(teamDetails)
const data = teamDetails.data
if (E.isRight(data)) {
@@ -326,11 +335,6 @@ const updateMemberRole = (userID: string, role: TeamMemberRole) => {
}
}
watch(
() => teamDetails.data,
(newVal) => console.log(newVal)
)
const membersList = computed(() => {
if (teamDetails.loading) return []