Skip to content

Commit

Permalink
Check for navigator.serviceWorker before using it
Browse files Browse the repository at this point in the history
  • Loading branch information
jbl2024 committed Apr 22, 2021
1 parent 926c1ad commit 7aa46be
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions imports/startup/client/serviceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
import { Meteor } from "meteor/meteor";

Meteor.startup(() => {
if (!navigator.serviceWorker) {
return;
}
navigator.serviceWorker
.register("/sw.js")
.catch((error) => {
Expand Down

0 comments on commit 7aa46be

Please sign in to comment.