Skip to content

Commit

Permalink
refactor: check navigator before getMessaging
Browse files Browse the repository at this point in the history
  • Loading branch information
becem-gharbi committed Feb 28, 2024
1 parent 04298eb commit 3474b09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/plugins/firebase.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default defineNuxtPlugin(() => {

const app = initializeApp(publicConfig.firebaseConfig)

const messaging = navigator.serviceWorker && getMessaging(app)
const messaging = navigator?.serviceWorker && getMessaging(app)

/* eslint-disable no-console */
getToken(messaging).catch(console.warn)
Expand Down

0 comments on commit 3474b09

Please sign in to comment.