Stringi la mano (fase prima)

This commit is contained in:
Surya Paolo
2023-01-08 19:20:25 +01:00
parent 4d40efc73a
commit 815ca0d565
9 changed files with 222 additions and 132 deletions

View File

@@ -85,7 +85,7 @@ export const useNotifStore = defineStore('NotifStore', {
}
},
async setBadgeIconApp(){
async setBadgeIconApp() {
// Get our dummy count and update it,
// just to give more context for this demo.
const countNow = this.getnumNotifUnread()
@@ -95,7 +95,7 @@ export const useNotifStore = defineStore('NotifStore', {
await navigator.setAppBadge(countNow)
.catch((error: any) => { /* ... */
});
}catch (e) {
} catch (e) {
}
},
@@ -104,12 +104,14 @@ export const useNotifStore = defineStore('NotifStore', {
return Api.SendReq(`/sendnotif/setall/${username}/${qualinotif}/${process.env.APP_ID}`, 'GET', null)
.then((res) => {
// console.log('res', res)
if (res) {
for (const rec of this.last_notifs) {
rec.read = true
setTimeout(() => {
if (res) {
for (const rec of this.last_notifs) {
rec.read = true
}
}
}
this.updateArrNotif()
this.updateArrNotif()
}, 3000)
})
.catch((error) => {
@@ -178,7 +180,7 @@ export const useNotifStore = defineStore('NotifStore', {
return ''
},
async updateNotifDataFromServer({ username, lastdataread }: {username: string, lastdataread: Date}) {
async updateNotifDataFromServer({ username, lastdataread }: { username: string, lastdataread: Date }) {
// console.log('updateNotifDataFromServer', username, lastdataread)
return Api.SendReq(`/sendnotif/${username}/${lastdataread}/${process.env.APP_ID}`, 'GET', null)