diff --git a/eventPage.js b/eventPage.js index 2d4d7b629b..5f97f1c3a4 100644 --- a/eventPage.js +++ b/eventPage.js @@ -10,6 +10,8 @@ I am using arbitrary dimensions which fixes the Windows 7 problem, hopefully it will get resolved in future release so other OSs won't have to use bigger dimensions by default. */ +'use strict'; + function start_app() { chrome.app.window.create('main.html', { id: 'main-window', @@ -79,7 +81,7 @@ chrome.runtime.onInstalled.addListener(function (details) { // only fire up notification sequence when one of the major version numbers changed if (currentVersionArr[0] != previousVersionArr[0] || currentVersionArr[1] != previousVersionArr[1]) { chrome.storage.local.get('update_notify', function (result) { - if (typeof result.update_notify === 'undefined' || result.update_notify) { + if (!result.update_notify || result.update_notify) { var manifest = chrome.runtime.getManifest(); var options = { priority: 0, diff --git a/js/serial_backend.js b/js/serial_backend.js index bb3bd090a2..fcabefbe7e 100644 --- a/js/serial_backend.js +++ b/js/serial_backend.js @@ -193,7 +193,7 @@ function read_serial(info) { function sensor_status(sensors_detected) { // initialize variable (if it wasn't) - if (sensor_status.previous_sensors_detected === 'undefined') { + if (!sensor_status.previous_sensors_detected) { sensor_status.previous_sensors_detected = 0; } diff --git a/main.js b/main.js index a6fde8b86c..4fa29d3b54 100644 --- a/main.js +++ b/main.js @@ -129,7 +129,7 @@ $(document).ready(function () { // if notifications are enabled, or wasn't set, check the notifications checkbox chrome.storage.local.get('update_notify', function (result) { - if (result.update_notify === 'undefined' || result.update_notify) { + if (!result.update_notify || result.update_notify) { $('div.notifications input').prop('checked', true); } });