Ver 0.5.55
Strette di Mano OK
This commit is contained in:
@@ -244,7 +244,6 @@ export const costanti = {
|
||||
MY_GROUPS: 21,
|
||||
USER_GROUPS: 22,
|
||||
HANDSHAKE: 23,
|
||||
REQ_HANDSHAKE: 24,
|
||||
ASK_SENT_HANDSHAKE: 25,
|
||||
|
||||
CREATE_GROUP: 30,
|
||||
|
||||
@@ -5468,7 +5468,7 @@ export const tools = {
|
||||
message: t('db.domanda_addtohandshake', { username: usernameDest }),
|
||||
ok: { label: t('dialog.yes'), push: true },
|
||||
cancel: { label: t('dialog.cancel') },
|
||||
title: t('db.domanda')
|
||||
title: t('handshake.strettadimano')
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setFriendsCmd($q, t, username, usernameDest, shared_consts.FRIENDSCMD.SETHANDSHAKE, null)
|
||||
@@ -5476,7 +5476,6 @@ export const tools = {
|
||||
if (res) {
|
||||
notifStore.updateNotification = true
|
||||
userStore.my.profile.handshake = [...userStore.my.profile.handshake, res]
|
||||
userStore.my.profile.req_handshake = userStore.my.profile.req_handshake.filter((rec: IFriends) => rec.username !== usernameDest)
|
||||
tools.showPositiveNotif($q, t('db.addedhandshake'))
|
||||
}
|
||||
})
|
||||
@@ -5572,27 +5571,6 @@ export const tools = {
|
||||
})
|
||||
},
|
||||
|
||||
refuseReqHandShake($q: any, username: string, usernameDest: string) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const notifStore = useNotifStore()
|
||||
$q.dialog({
|
||||
message: t('db.domanda_revoke_handshake', { 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.REMOVE_FROM_MYHANDSHAKE, null).then((res) => {
|
||||
if (res) {
|
||||
notifStore.updateNotification = true
|
||||
userStore.my.profile.req_handshake = userStore.my.profile.req_handshake.filter((user: IFriends) => user.username !== usernameDest)
|
||||
tools.showPositiveNotif($q, t('db.removedhandshake'))
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
updateMyData(res: any) {
|
||||
const userStore = useUserStore()
|
||||
const circuitStore = useCircuitStore()
|
||||
@@ -5874,7 +5852,7 @@ export const tools = {
|
||||
})
|
||||
},
|
||||
|
||||
setRequestHandShake($q: any, username: string, usernameDest: string, value: boolean) {
|
||||
setHandShake($q: any, username: string, usernameDest: string, value: boolean) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
@@ -5897,16 +5875,14 @@ export const tools = {
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setFriendsCmd($q, t, username, usernameDest, shared_consts.FRIENDSCMD.REQHANDSHAKE, value)
|
||||
userStore.setFriendsCmd($q, t, username, usernameDest, shared_consts.FRIENDSCMD.SETHANDSHAKE, value)
|
||||
.then((res: any) => {
|
||||
if (res) {
|
||||
if (value) {
|
||||
// ADD to req HandShake
|
||||
userStore.my.profile.asked_handshake.push(res)
|
||||
tools.showPositiveNotif($q, t('db.askedtohandshake', { username: usernameDest }))
|
||||
} else {
|
||||
// REMOVE to req HandShake
|
||||
userStore.my.profile.asked_handshake = userStore.my.profile.asked_handshake.filter((rec: IUserFields) => rec.username !== usernameDest)
|
||||
tools.showPositiveNotif($q, t('db.revoketohandshake', { username: usernameDest }))
|
||||
}
|
||||
|
||||
@@ -5975,23 +5951,6 @@ export const tools = {
|
||||
})
|
||||
})
|
||||
},
|
||||
cancelReqHandShake($q: any, username: string, usernameDest: string) {
|
||||
const userStore = useUserStore()
|
||||
$q.dialog({
|
||||
message: t('db.domanda_cancel_req_handshake', { 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.CANCEL_REQ_HANDSHAKE, null).then((res) => {
|
||||
if (res) {
|
||||
userStore.my.profile.asked_handshake = userStore.my.profile.asked_handshake.filter((rec: IUserFields) => rec.username !== usernameDest)
|
||||
tools.showPositiveNotif($q, t('db.cancel_req_handshake'))
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
cancelReqGroups($q: any, username: string, groupnameDest: string) {
|
||||
const userStore = useUserStore()
|
||||
$q.dialog({
|
||||
@@ -6613,14 +6572,8 @@ export const tools = {
|
||||
tools.cancelReqFriends($q, username, dest)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.SETHANDSHAKE) {
|
||||
tools.addToMyHandShake($q, username, dest)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.REQHANDSHAKE) {
|
||||
tools.setRequestHandShake($q, username, dest, value)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.REMOVE_FROM_MYHANDSHAKE) {
|
||||
tools.removeFromMyHandShake($q, username, dest)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.REFUSE_REQ_HANDSHAKE) {
|
||||
tools.refuseReqHandShake($q, username, dest)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.CANCEL_REQ_HANDSHAKE) {
|
||||
tools.cancelReqHandShake($q, username, dest)
|
||||
} else if (cmd === shared_consts.CIRCUITCMD.SET) {
|
||||
tools.addToMyCircuits($q, username, dest)
|
||||
} else if (cmd === shared_consts.CIRCUITCMD.REQ) {
|
||||
|
||||
Reference in New Issue
Block a user