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) {
|
||||
|
||||
@@ -111,7 +111,7 @@ export const useNotifStore = defineStore('NotifStore', {
|
||||
}
|
||||
}
|
||||
this.updateArrNotif()
|
||||
}, 3000)
|
||||
}, 20000)
|
||||
|
||||
})
|
||||
.catch((error) => {
|
||||
|
||||
@@ -66,8 +66,6 @@ export const DefaultUser: IUserFields = {
|
||||
friends: [],
|
||||
req_friends: [],
|
||||
handshake: [],
|
||||
req_handshake: [],
|
||||
asked_handshake: [],
|
||||
mygroups: [],
|
||||
mycircuits: [],
|
||||
manage_mygroups: [],
|
||||
@@ -127,8 +125,6 @@ export const DefaultProfile: IUserProfile = {
|
||||
friends: [],
|
||||
req_friends: [],
|
||||
handshake: [],
|
||||
req_handshake: [],
|
||||
asked_handshake: [],
|
||||
mygroups: [],
|
||||
mycircuits: [],
|
||||
manage_mygroups: [],
|
||||
@@ -233,6 +229,13 @@ export const useUserStore = defineStore('UserStore', {
|
||||
return false
|
||||
},
|
||||
|
||||
IsHandShakeByMe(user: IUserFields): boolean {
|
||||
if (user && user.profile && user.profile.handshake)
|
||||
return user.profile.handshake.findIndex((rec) => rec.username === this.my.username) >= 0
|
||||
else
|
||||
return false
|
||||
},
|
||||
|
||||
IsMyGroupByGroupname(groupname: string): boolean {
|
||||
if (this.my.profile.mygroups)
|
||||
return this.my.profile.mygroups.findIndex((rec) => rec.groupname === groupname) >= 0
|
||||
@@ -263,13 +266,6 @@ export const useUserStore = defineStore('UserStore', {
|
||||
return false
|
||||
},
|
||||
|
||||
IsAskedHandShakeByUsername(username: string): boolean {
|
||||
if (this.my.profile.asked_handshake)
|
||||
return this.my.profile.asked_handshake.findIndex((rec) => rec.username === username) >= 0
|
||||
else
|
||||
return false
|
||||
},
|
||||
|
||||
IsReqFriendByUsername(username: string): boolean {
|
||||
if (this.my.profile.req_friends)
|
||||
return this.my.profile.req_friends.findIndex((rec) => rec.username === username) >= 0
|
||||
@@ -277,13 +273,6 @@ export const useUserStore = defineStore('UserStore', {
|
||||
return false
|
||||
},
|
||||
|
||||
IsReqHandShakeByUsername(username: string): boolean {
|
||||
if (this.my.profile.req_handshake)
|
||||
return this.my.profile.req_handshake.findIndex((rec) => rec.username === username) >= 0
|
||||
else
|
||||
return false
|
||||
},
|
||||
|
||||
IsAskedGroupByGroupname(groupname: string): boolean {
|
||||
if (this.my.profile.asked_groups)
|
||||
return this.my.profile.asked_groups.findIndex((rec: IGroupShort) => rec.groupname === groupname) >= 0
|
||||
@@ -766,7 +755,6 @@ export const useUserStore = defineStore('UserStore', {
|
||||
// Memory
|
||||
this.my.profile.manage_mygroups = []
|
||||
this.my.profile.asked_friends = []
|
||||
this.my.profile.asked_handshake = []
|
||||
this.my.profile.asked_groups = []
|
||||
this.my.profile.refused_groups = []
|
||||
}
|
||||
@@ -1291,8 +1279,6 @@ export const useUserStore = defineStore('UserStore', {
|
||||
this.my.profile.asked_friends = data.listSentRequestFriends ? data.listSentRequestFriends : []
|
||||
|
||||
this.my.profile.handshake = data.listHandShake ? data.listHandShake : []
|
||||
this.my.profile.req_handshake = data.listRequestHandShake ? data.listRequestHandShake : []
|
||||
this.my.profile.asked_handshake = data.listSentRequestHandShake ? data.listSentRequestHandShake : []
|
||||
},
|
||||
|
||||
async loadFriends() {
|
||||
|
||||
Reference in New Issue
Block a user