fix bug list circuits and transactionsenabled

This commit is contained in:
Paolo Arena
2022-09-24 20:21:29 +02:00
parent bc2080c42c
commit 201d148e31
29 changed files with 299 additions and 332 deletions

View File

@@ -87,32 +87,42 @@ export default defineComponent({
*/
watch(() => myrecfiltertoggle.value, (value: any, oldval: any) => {
if (value === tools.FILTER_MYREC) {
if (props.table === toolsext.TABMYGROUPS) {
filtercustom.value = [{
'admins': {
$elemMatch: { username: { $eq: userStore.my.username } }
},
}]
} else if (props.table === toolsext.TABCIRCUITS) {
filtercustom.value = [{
'admins': {
$elemMatch: { username: { $eq: userStore.my.username } }
},
}]
} else {
filtercustom.value = [{ userId: userStore.my._id }]
}
function updatefilter(value: any) {
if (value === tools.FILTER_MYREC) {
if (props.table === toolsext.TABMYGROUPS) {
filtercustom.value = [{
'admins': {
$elemMatch: { username: { $eq: userStore.my.username } }
},
}]
} else if (props.table === toolsext.TABCIRCUITS) {
filtercustom.value = [{
'admins': {
$elemMatch: { username: { $eq: userStore.my.username } }
},
}]
} else if (value === tools.FILTER_MYFOLLOW) {
if (props.table === toolsext.TABMYGROUPS) {
}
} else {
filtercustom.value = []
filtercustom.value = [{ userId: userStore.my._id }]
}
} else if (value === tools.FILTER_MYFOLLOW) {
if (props.table === toolsext.TABMYGROUPS) {
}
} else {
filtercustom.value = []
}
}
watch(() => filtercustom.value, (value: any, oldval: any) => {
updatefilter(myrecfiltertoggle.value)
})
watch(() => myrecfiltertoggle.value, (value: any, oldval: any) => {
updatefilter(value)
},
)