|
@@ -9,11 +9,31 @@ import { useRegisterSW } from 'virtual:pwa-register/vue';
|
|
import { useUserStore } from './store/modules/users';
|
|
import { useUserStore } from './store/modules/users';
|
|
export function unregister() {
|
|
export function unregister() {
|
|
console.log('unregister - outer');
|
|
console.log('unregister - outer');
|
|
|
|
+
|
|
if ('serviceWorker' in navigator) {
|
|
if ('serviceWorker' in navigator) {
|
|
console.log('unregister - pwa');
|
|
console.log('unregister - pwa');
|
|
navigator.serviceWorker.ready.then(registration => {
|
|
navigator.serviceWorker.ready.then(registration => {
|
|
registration.unregister();
|
|
registration.unregister();
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ navigator.serviceWorker
|
|
|
|
+ .getRegistrations()
|
|
|
|
+ .then(registrations => {
|
|
|
|
+ for (const registration of registrations) {
|
|
|
|
+ registration.unregister().then(boolean => {
|
|
|
|
+ if (boolean) {
|
|
|
|
+ console.log('Service Worker unregistered successfully');
|
|
|
|
+ } else {
|
|
|
|
+ console.log('Service Worker unregistration failed');
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch(error => {
|
|
|
|
+ console.error('Error getting Service Worker registrations:', error);
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ console.log('Service Workers are not supported in this browser');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|