Visu Sent Monete

This commit is contained in:
Paolo Arena
2022-09-13 12:28:33 +02:00
parent f59691985a
commit 44c75768c6
29 changed files with 301 additions and 69 deletions

View File

@@ -25,6 +25,12 @@ export const useNotifStore = defineStore('NotifStore', {
},
getnotifs_coinsreq: (mystate: INotifState) => (): INotif[] => {
const ctrec = (mystate.last_notifs) ? mystate.last_notifs.slice(0, 20).filter((rec) => !rec.read && rec.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS && rec.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_SENDCOINSREQ) : []
return (ctrec)
},
getnumNotifUnread: (mystate: INotifState) => () => {
const myarr = mystate.last_notifs.filter((notif) => !notif.read)
return (tools.isArray(myarr) ? myarr.length : 0)
@@ -55,6 +61,19 @@ export const useNotifStore = defineStore('NotifStore', {
this.updateArrNotif()
},
updateRecNotif(recnotif: INotif) {
if (recnotif) {
const myrec = this.last_notifs.find((rec: any) => rec._id === recnotif._id)
if (myrec) {
myrec.status = recnotif.status
myrec.read = recnotif.read
myrec.descr = recnotif.descr
this.updateArrNotif()
}
}
},
async setBadgeIconApp(){
// Get our dummy count and update it,
// just to give more context for this demo.