Skip to content

Commit

Permalink
Messaging: Convert from var to const (#354)
Browse files Browse the repository at this point in the history
* update firebase SDK version in service worker

* Convert from var to const for consistency
  • Loading branch information
jhuleatt committed Aug 8, 2019
1 parent 8bb9a17 commit 8581e1b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.json
@@ -1,4 +1,7 @@
{
"parserOptions": {
"ecmaVersion": 2017
},
"env": {
"browser": true
},
Expand Down
6 changes: 3 additions & 3 deletions messaging/firebase-messaging-sw.js
Expand Up @@ -5,7 +5,7 @@ importScripts('/__/firebase/6.3.4/firebase-app.js');
importScripts('/__/firebase/6.3.4/firebase-messaging.js');
importScripts('/__/firebase/init.js');

var messaging = firebase.messaging();
const messaging = firebase.messaging();

/**
* Here is is the code snippet to initialize Firebase Messaging in the Service
Expand Down Expand Up @@ -38,8 +38,8 @@ var messaging = firebase.messaging();
messaging.setBackgroundMessageHandler(function(payload) {
console.log('[firebase-messaging-sw.js] Received background message ', payload);
// Customize notification here
var notificationTitle = 'Background Message Title';
var notificationOptions = {
const notificationTitle = 'Background Message Title';
const notificationOptions = {
body: 'Background Message body.',
icon: '/firebase-logo.png'
};
Expand Down
2 changes: 1 addition & 1 deletion messaging/index.html
Expand Up @@ -156,7 +156,7 @@ <h4>Needs Permission</h4>

function showToken(currentToken) {
// Show token in console and UI.
var tokenElement = document.querySelector('#token');
const tokenElement = document.querySelector('#token');
tokenElement.textContent = currentToken;
}

Expand Down

0 comments on commit 8581e1b

Please sign in to comment.