fix strette di mano

This commit is contained in:
Surya Paolo
2023-01-09 04:05:18 +01:00
parent d684d7a46f
commit a9367d5aef
4 changed files with 311 additions and 206 deletions

View File

@@ -52,27 +52,27 @@ export default defineComponent({
const { getRefLink } = MixinUsers()
const animation = ref('fade')
const quantiHandShake = ref('')
const quanteHandShakeInCommon = ref('')
const usersList = ref({show: false, title: '', list: []})
const usersList = ref({ show: false, title: '', list: [] })
const username = computed(() => $route.params.username ? $route.params.username.toString() : userStore.my.username)
const idnotif = computed(() => $route.query.idnotif ? $route.query.idnotif.toString() : '')
const isDebugOn = computed(() => tools.isDebugOn())
const filtroutente = ref(<any[]>[])
const showPic = ref(false)
const caricato = ref(false)
const showsendCoinTo = ref(false)
const showinghand = ref(false)
const myuser = ref(<IUserFields | null>null)
const handshake_inCommon = ref(<IFriends[]>[])
const actualcard = ref('mygoods')
const notifStore = useNotifStore()
const quantiHandShake = computed(() => (userStore.userprofile.profile.handshake ? userStore.userprofile.profile.handshake.length : 0) + ' ' + t('handshake.strettedimano'))
const handshake_inCommon = computed(() => userStore.getMyHandshakeInCommon(userStore.userprofile))
const quanteHandShakeInCommon = computed(() => (handshake_inCommon.value ? handshake_inCommon.value.length : 0) + ' ' + t('handshake.incommon'))
const mycards = computed(() => {
return costanti.MAINCARDS.filter((rec: any) => rec.table)
})
@@ -97,23 +97,21 @@ export default defineComponent({
if (username.value) {
await userStore.loadUserProfile({ username: username.value, idnotif: idnotif.value }).then((ris) => {
console.log('loadUserProfile = ', ris)
myuser.value = ris
if (myuser.value) {
filtroutente.value = [{ userId: myuser.value._id }]
userStore.userprofile = ris
if (userStore.userprofile) {
filtroutente.value = [{ userId: userStore.userprofile._id }]
notifStore.setAsRead(idnotif.value)
quantiHandShake.value = (myuser.value.profile.handshake ? myuser.value.profile.handshake.length : 0) + ' ' + t('handshake.strettedimano')
handshake_inCommon.value = userStore.getMyHandshakeInCommon(myuser.value)
quanteHandShakeInCommon.value = (handshake_inCommon.value ? handshake_inCommon.value.length : 0) + ' ' + t('handshake.incommon')
try {
listgroupsfiltered.value = globalStore.mygroups.filter((grp: IMyGroup) => myuser.value!.profile.mygroups.findIndex((rec: IMyGroup) => rec.groupname === grp.groupname) >= 0)
if (userStore.userprofile)
listgroupsfiltered.value = globalStore.mygroups.filter((grp: IMyGroup) => userStore.userprofile.profile.mygroups.findIndex((rec: IMyGroup) => rec.groupname === grp.groupname) >= 0)
} catch (e) {
listgroupsfiltered.value = []
}
try {
listcircuitsfiltered.value = myuser.value.profile.mycircuits
listcircuitsfiltered.value = userStore.userprofile.profile.mycircuits
} catch (e) {
listcircuitsfiltered.value = []
}
@@ -123,7 +121,7 @@ export default defineComponent({
caricato.value = true
}
}catch (e) {
} catch (e) {
console.error('ERR loadProfile', e)
}
}
@@ -141,8 +139,8 @@ export default defineComponent({
}
function getImgUser() {
if (myuser.value)
return userStore.getImgByProfile(myuser.value)
if (userStore.userprofile)
return userStore.getImgByProfile(userStore.userprofile)
else
return ''
}
@@ -164,7 +162,6 @@ export default defineComponent({
tools,
toolsext,
costanti,
myuser,
shared_consts,
getImgUser,
checkifShow,