Workbox
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
} from '@model'
|
||||
|
||||
const functionality: IFunctionality = {
|
||||
PWA: false,
|
||||
PWA: true,
|
||||
SHOW_USER_MENU: true, // Cambiare con true
|
||||
SHOW_PROFILE: true,
|
||||
SHOW_REG_BUTTON: true,
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
<meta name="msapplication-tap-highlight" content="no">
|
||||
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<% if (ctx.mode.cordova || ctx.mode.capacitor) { %>, viewport-fit=cover<% } %>">
|
||||
|
||||
<link rel="icon" type="image/png" sizes="128x128" href="icons/favicon-128x128.png">
|
||||
<link rel="icon" type="image/png" sizes="96x96" href="icons/favicon-96x96.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="icons/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="icons/favicon-16x16.png">
|
||||
<link rel="icon" type="image/ico" href="favicon.ico">
|
||||
|
||||
@@ -103,7 +103,7 @@ export const Api = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
||||
return new Promise((resolve, reject) => sendRequest(url, method, mydataout)
|
||||
.then((res) => {
|
||||
// console.log('res', res)
|
||||
console.log('status:', res.status)
|
||||
|
||||
setTimeout(() => {
|
||||
if (method === 'get') {
|
||||
|
||||
@@ -561,6 +561,7 @@ export const useUserStore = defineStore('UserStore', {
|
||||
try {
|
||||
if (static_data.functionality.PWA) {
|
||||
if ('serviceWorker' in navigator) {
|
||||
console.log('serviceWorker')
|
||||
sub = await navigator.serviceWorker.ready
|
||||
.then((swreg) => {
|
||||
console.log('swreg')
|
||||
@@ -586,6 +587,8 @@ export const useUserStore = defineStore('UserStore', {
|
||||
openUrl: '/',
|
||||
}
|
||||
|
||||
console.log('2')
|
||||
|
||||
const usertosend = {
|
||||
username: authData.username.trim(),
|
||||
password: authData.password.trim(),
|
||||
@@ -604,6 +607,7 @@ export const useUserStore = defineStore('UserStore', {
|
||||
|
||||
return Api.SendReq('/users/login', 'POST', usertosend, true)
|
||||
.then((res) => {
|
||||
|
||||
myres = res
|
||||
|
||||
if (myres.status !== 200) {
|
||||
@@ -643,6 +647,7 @@ export const useUserStore = defineStore('UserStore', {
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('error', error)
|
||||
this.setErrorCatch(error)
|
||||
return this.getServerCode
|
||||
})
|
||||
|
||||
@@ -463,7 +463,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
return swreg.pushManager.getSubscription()
|
||||
})
|
||||
.then((subscription) => {
|
||||
console.log('subscription = ', subscription)
|
||||
console.log('!!!!!!!! subscription = ', subscription)
|
||||
|
||||
this.wasAlreadySubscribed = !(subscription === null)
|
||||
|
||||
@@ -491,6 +491,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
|
||||
// Calling the Server to Save in the MongoDB the Subscriber
|
||||
saveNewSubscriptionToServer(newSub: any) {
|
||||
console.log('saveNewSubscriptionToServer')
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user