bottoni fiducia
This commit is contained in:
@@ -5568,22 +5568,26 @@ export const tools = {
|
||||
})
|
||||
},
|
||||
|
||||
addToMyTrust($q: any, username: string, usernameDest: string) {
|
||||
addToMyTrust($q: any, username: string, usernameDest: string, value: boolean) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const notifStore = useNotifStore()
|
||||
$q.dialog({
|
||||
message: t('db.domanda_trusted', { username: usernameDest }),
|
||||
message: t(value ? 'db.domanda_trusted' : 'db.domanda_reject', { username: usernameDest }),
|
||||
ok: { label: t('dialog.yes'), push: true },
|
||||
cancel: { label: t('dialog.cancel') },
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setFriendsCmd($q, t, username, usernameDest, shared_consts.FRIENDSCMD.SETTRUST, null)
|
||||
userStore.setFriendsCmd($q, t, username, usernameDest, shared_consts.FRIENDSCMD.SETTRUST, value)
|
||||
.then((res: any) => {
|
||||
if (res) {
|
||||
userStore.my.profile.userstoverify = userStore.my.profile.userstoverify.filter((rec: any) => rec.username !== usernameDest)
|
||||
tools.showPositiveNotif($q, t('db.trusted'))
|
||||
|
||||
if (value)
|
||||
tools.showPositiveNotif($q, t('db.trusted', {username: usernameDest}))
|
||||
else
|
||||
tools.showNegativeNotif($q, t('db.rejected', {username: usernameDest}))
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -6884,7 +6888,7 @@ export const tools = {
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.SETFRIEND) {
|
||||
tools.addToMyFriends($q, username, dest)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.SETTRUST) {
|
||||
tools.addToMyTrust($q, username, dest)
|
||||
tools.addToMyTrust($q, username, dest, value)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.REQFRIEND) {
|
||||
tools.setRequestFriendship($q, username, dest, value)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS) {
|
||||
|
||||
Reference in New Issue
Block a user