Stringi la mano (fase prima)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user