fix message

This commit is contained in:
Peter Maquiran
2024-10-23 15:30:15 +01:00
parent 4396b17909
commit 5a64376b03
12 changed files with 116 additions and 161 deletions
-20
View File
@@ -34,26 +34,6 @@ if (environment.production) {
SentrySibling.init
); */
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/firebase-messaging-sw.js')
.then(registration => {
console.log('Service Worker registrado com sucesso:', registration);
// Send data to the service worker
if (registration.active) {
registration.active.postMessage({ type: 'INIT_WEBSOCKET', url: 'wss://example.com/socket' });
} else {
navigator.serviceWorker.ready.then(registration => {
registration.active.postMessage({ type: 'INIT_WEBSOCKET', url: 'wss://example.com/socket' });
});
}
})
.catch(error => {
console.error('Erro ao registrar o Service Worker:', error);
});
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.log(err));