Conto Comunitario all'interno di un Circuito
This commit is contained in:
@@ -32,7 +32,7 @@ export const useNotifStore = defineStore('NotifStore', {
|
||||
},
|
||||
|
||||
getnotifs_coinsreq: (mystate: INotifState) => (): INotif[] => {
|
||||
const ctrec = (mystate.last_notifs) ? mystate.last_notifs.slice(0, 20).filter((rec) => rec.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS && rec.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_SENDCOINSREQ && rec.status === 0) : []
|
||||
const ctrec = (mystate.last_notifs) ? mystate.last_notifs.slice(0, 20).filter((rec) => rec.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS && rec.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_SENDCOINSREQ && rec.status === shared_consts.CircuitsNotif.STATUS_NONE) : []
|
||||
return (ctrec)
|
||||
|
||||
},
|
||||
@@ -84,6 +84,13 @@ export const useNotifStore = defineStore('NotifStore', {
|
||||
}
|
||||
}
|
||||
},
|
||||
updateArrRecNotifFromServer(arrrecnotif: INotif[]) {
|
||||
if (arrrecnotif && arrrecnotif.length > 0) {
|
||||
this.last_notifs = arrrecnotif
|
||||
|
||||
this.updateArrNotif()
|
||||
}
|
||||
},
|
||||
|
||||
async setBadgeIconApp() {
|
||||
// Get our dummy count and update it,
|
||||
@@ -244,6 +251,30 @@ export const useNotifStore = defineStore('NotifStore', {
|
||||
setCountNotifs(num: number) {
|
||||
this.countNotif = num
|
||||
},
|
||||
|
||||
getLastNotif(username: string): any {
|
||||
// Get msg for this chat
|
||||
if (this.last_notifs)
|
||||
return this.last_notifs.find((rec: INotif) => rec.dest === username)
|
||||
// return users_msg_saved[username]
|
||||
},
|
||||
|
||||
getLastDataRead(username: string): any {
|
||||
// Get msg for this
|
||||
|
||||
let myrec = this.getLastNotif(username)
|
||||
const lastdata: any = (myrec && myrec.lastdataread) ? myrec.lastdataread : tools.getLastDateReadReset()
|
||||
|
||||
let mydate = ''
|
||||
if (!tools.isIsoDate(lastdata))
|
||||
mydate = lastdata.toISOString()
|
||||
else
|
||||
return lastdata
|
||||
|
||||
return mydate
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user