++ aggiunta la prenotazione negli eventi. con la lista degli utenti.
This commit is contained in:
@@ -48,17 +48,17 @@ export const useMessageStore = defineStore('MessageStore', {
|
||||
// console.table(users_msg.msgs)
|
||||
|
||||
if (users_msg.msgs) {
|
||||
let userother = users_msg.msgs.slice(-1)[0].dest.username
|
||||
let userother: any = users_msg.msgs.slice(-1)[0].dest
|
||||
if (userother === userStore.my.username)
|
||||
userother = users_msg.msgs.slice(-1)[0].origin.username
|
||||
userother = users_msg.msgs.slice(-1)[0].origin
|
||||
|
||||
let index = this.last_msgs.findIndex((rec: IMessage) => (rec.dest!.username === userother) || (rec.origin!.username === userother))
|
||||
let index = this.last_msgs.findIndex((rec: IMessage) => (rec.dest === userother) || (rec.origin === userother))
|
||||
if (index >= 0) {
|
||||
// Update last message
|
||||
this.last_msgs[index] = users_msg.msgs.slice(-1)[0]
|
||||
} else {
|
||||
this.last_msgs.push(users_msg.msgs.slice(-1)[0])
|
||||
index = this.last_msgs.findIndex((rec: IMessage) => (rec.dest!.username === userother) || (rec.origin!.username === userother))
|
||||
index = this.last_msgs.findIndex((rec: IMessage) => (rec.dest === userother) || (rec.origin === userother))
|
||||
}
|
||||
if (this.last_msgs[index])
|
||||
users_msg.lastdataread = this.last_msgs[index].datemsg
|
||||
@@ -101,8 +101,7 @@ export const useMessageStore = defineStore('MessageStore', {
|
||||
|
||||
data.source!.page = ''
|
||||
data.idapp = process.env.APP_ID
|
||||
data.origin!.idapp = process.env.APP_ID
|
||||
data.origin!.username = userStore.my.username
|
||||
data.origin = userStore.my.username
|
||||
data.datemsg = tools.getDateNow()
|
||||
data.status = StatusMessage.WaitingToSend
|
||||
// Options
|
||||
@@ -122,7 +121,7 @@ export const useMessageStore = defineStore('MessageStore', {
|
||||
const myarr = []
|
||||
myarr.push(data)
|
||||
|
||||
this.setMsg(myarr, data.dest!.username!)
|
||||
this.setMsg(myarr, data.dest)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user