Click per mandare un messaggio al Destinatario dei RIS, se non è entrato ancora in RIS ITALIA.

This commit is contained in:
Surya Paolo
2023-11-19 23:40:50 +01:00
parent 0642375eaf
commit 446b555b46
20 changed files with 335 additions and 18 deletions

View File

@@ -100,6 +100,7 @@ export const DefaultUser: IUserFields = {
stepTutorial: 0,
noNameSurname: false,
noCircuit: false,
noCircIta: false,
noFoto: false,
asked_circuits: [],
refused_circuits: [],
@@ -168,6 +169,7 @@ export const DefaultProfile: IUserProfile = {
stepTutorial: 0,
noNameSurname: false,
noCircuit: false,
noCircIta: false,
noFoto: false,
asked_circuits: [],
refused_circuits: [],
@@ -500,7 +502,7 @@ export const useUserStore = defineStore('UserStore', {
}
// se non ho neanche 1 circuito in comune, metto il mio preferito
if (arrfinale.length <= 0) {
/*if (arrfinale.length <= 0) {
const circuit = circuitStore.getCircuitByProvince(this.my.profile.resid_province)
if (circuit)
arrfinale.push(circuit.name)
@@ -510,7 +512,7 @@ export const useUserStore = defineStore('UserStore', {
}
}
} else {
}
} */
console.log('arrout', arrfinale)
@@ -953,6 +955,17 @@ export const useUserStore = defineStore('UserStore', {
return await this.execDbOpUser({ mydata })
}
},
async savenoCircIta(val: boolean) {
const mydata = {
_id: this.my._id,
dbop: 'noCircIta',
value: val,
}
if (this.my.profile.noCircIta !== val) {
this.my.profile.noCircIta = val
return await this.execDbOpUser({ mydata })
}
},
async savenoFoto(val: boolean) {
const mydata = {
_id: this.my._id,
@@ -1626,6 +1639,21 @@ export const useUserStore = defineStore('UserStore', {
},
async setSendCmd($q: any, t: any, usernameOrig: string, usernameDest: string, cmd: number, value: any) {
return Api.SendReq('/users/sendcmd', 'POST', { usernameOrig, usernameDest, cmd, value })
.then((res) => {
this.updateTables = true
// const notifStore = useNotifStore()
// notifStore.updateNotification = true
return res.data
}).catch((error) => {
tools.showNegativeNotif($q, t('db.recfailed'))
return {}
})
},
async setCircuitCmd($q: any, t: any, usernameOrig: string, circuitname: string, cmd: number, value: any, extrarec?: any) {
return await Api.SendReq('/users/circuits/cmd', 'POST', { usernameOrig, circuitname, cmd, value, extrarec })
.then((res) => {
@@ -1849,12 +1877,15 @@ export const useUserStore = defineStore('UserStore', {
let yes = true
// Check if I have at least 1 Circuit
yes = yes && (this.my.profile.mycircuits.length > 0)
if (this.my.profile && this.my.profile.mycircuits) {
if (myuser && myuser.profile && myuser.profile.mycircuits) {
// Check if myuser has at least 1 Circuit
yes = yes && (myuser.profile.mycircuits.length > 0)
// Check if I have at least 1 Circuit
yes = yes && (this.my.profile.mycircuits.length > 0)
if (myuser && myuser.profile && myuser.profile.mycircuits) {
// Check if myuser has at least 1 Circuit
yes = yes && (myuser.profile.mycircuits.length > 0)
}
}
return yes
@@ -1902,7 +1933,7 @@ export const useUserStore = defineStore('UserStore', {
const dateold = tools.addDays(tools.getDateNow(), -(30 * 6))
if (this.my)
return this.my.date_reg! && new Date(this.my.date_reg).getTime() < dateold.getTime()
else
else
return true
} catch (e) {
return false