From 1aaaca4e6c97a6403709327511c0a363d7815fd6 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 28 Sep 2018 10:48:20 -0700 Subject: [PATCH] Code review changes --- cmake/templates/NSIS.template.in | 2 +- server-console/src/modules/hf-acctinfo.js | 6 ++--- server-console/src/modules/hf-app.js | 12 +++++----- .../src/modules/hf-notifications.js | 22 +++++++++---------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index b67cdf3eea..3226712519 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -945,7 +945,7 @@ Function HandlePostInstallOptions Delete "$SMSTARTUP\@PRE_SANDBOX_CONSOLE_SHORTCUT_NAME@.lnk" ; make a startup shortcut in this user's current context - ; use the console shortcut name regardless of server/interface install + ; use the console shortcut name regardless of server/interface install SetShellVarContext current CreateShortCut "$SMSTARTUP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" diff --git a/server-console/src/modules/hf-acctinfo.js b/server-console/src/modules/hf-acctinfo.js index 828bc781b8..d20748544f 100644 --- a/server-console/src/modules/hf-acctinfo.js +++ b/server-console/src/modules/hf-acctinfo.js @@ -66,7 +66,7 @@ AccountInfo.prototype = { case VariantTypes.USER_TYPE: //user type var userTypeName = this._parseByteArray().toString('ascii').slice(0,-1); - if (userTypeName == "DataServerAccountInfo") { + if (userTypeName === "DataServerAccountInfo") { return this._parseDataServerAccountInfo(); } else { @@ -77,7 +77,7 @@ AccountInfo.prototype = { }, _parseByteArray: function () { var length = this._parseUInt32(); - if (length == 0xffffffff) { + if (length === 0xffffffff) { return null; } var result = this.rawData.slice(this.parseOffset, this.parseOffset+length); @@ -91,7 +91,7 @@ AccountInfo.prototype = { } // length in bytes; var length = this._parseUInt32(); - if (length == 0xFFFFFFFF) { + if (length === 0xFFFFFFFF) { return null; } diff --git a/server-console/src/modules/hf-app.js b/server-console/src/modules/hf-app.js index 3c9505abdd..3db48bd9c4 100644 --- a/server-console/src/modules/hf-app.js +++ b/server-console/src/modules/hf-app.js @@ -15,9 +15,9 @@ const osType = os.type(); exports.getBuildInfo = function() { var buildInfoPath = null; - if (osType == 'Windows_NT') { + if (osType === 'Windows_NT') { buildInfoPath = path.join(path.dirname(process.execPath), 'build-info.json'); - } else if (osType == 'Darwin') { + } else if (osType === 'Darwin') { var contentPath = ".app/Contents/"; var contentEndIndex = __dirname.indexOf(contentPath); @@ -67,9 +67,9 @@ exports.startInterface = function(url) { } exports.isInterfaceRunning = function(done) { - if (osType == 'Windows_NT') { + if (osType === 'Windows_NT') { var pInterface = new Process('interface', 'interface.exe'); - } else if (osType == 'Darwin') { + } else if (osType === 'Darwin') { var pInterface = new Process('interface', 'interface'); } return pInterface.isRunning(done); @@ -78,13 +78,13 @@ exports.isInterfaceRunning = function(done) { exports.getRootHifiDataDirectory = function(local) { var organization = buildInfo.organization; - if (osType == 'Windows_NT') { + if (osType === 'Windows_NT') { if (local) { return path.resolve(osHomeDir(), 'AppData/Local', organization); } else { return path.resolve(osHomeDir(), 'AppData/Roaming', organization); } - } else if (osType == 'Darwin') { + } else if (osType === 'Darwin') { return path.resolve(osHomeDir(), 'Library/Application Support', organization); } else { return path.resolve(osHomeDir(), '.local/share/', organization); diff --git a/server-console/src/modules/hf-notifications.js b/server-console/src/modules/hf-notifications.js index 2953075523..0cc4da02c0 100644 --- a/server-console/src/modules/hf-notifications.js +++ b/server-console/src/modules/hf-notifications.js @@ -51,8 +51,8 @@ HifiNotification.prototype = { var app = null; switch (this.type) { case NotificationType.GOTO: - if (typeof(this.data) == "number") { - if (this.data == 1) { + if (typeof(this.data) === "number") { + if (this.data === 1) { text = "You have " + this.data + " event invitation pending." } else { text = "You have " + this.data + " event invitations pending." @@ -67,8 +67,8 @@ HifiNotification.prototype = { break; case NotificationType.PEOPLE: - if (typeof(this.data) == "number") { - if (this.data == 1) { + if (typeof(this.data) === "number") { + if (this.data === 1) { text = this.data + " of your connections is online." } else { text = this.data + " of your connections are online." @@ -83,8 +83,8 @@ HifiNotification.prototype = { break; case NotificationType.WALLET: - if (typeof(this.data) == "number") { - if (this.data == 1) { + if (typeof(this.data) === "number") { + if (this.data === 1) { text = "You have " + this.data + " unread Wallet transaction."; } else { text = "You have " + this.data + " unread Wallet transactions."; @@ -99,8 +99,8 @@ HifiNotification.prototype = { break; case NotificationType.MARKETPLACE: - if (typeof(this.data) == "number") { - if (this.data == 1) { + if (typeof(this.data) === "number") { + if (this.data === 1) { text = this.data + " of your purchased items has an update available."; } else { text = this.data + " of your purchased items have updates available."; @@ -124,7 +124,7 @@ HifiNotification.prototype = { }, function (error, reason, metadata) { if(_finished) { - if (osType == 'Darwin') { + if (osType === 'Darwin') { setTimeout(_finished, OSX_CLICK_DELAY_TIMEOUT); } else { _finished(); @@ -215,7 +215,7 @@ HifiNotifications.prototype = { _showNotification: function () { var _this = this; - if (osType == 'Darwin') { + if (osType === 'Darwin') { this.pendingNotifications[0].show(function () { // For OSX // don't attempt to show the next notification @@ -238,7 +238,7 @@ HifiNotifications.prototype = { }, _addNotification: function (notification) { this.pendingNotifications.push(notification); - if(this.pendingNotifications.length == 1) { + if(this.pendingNotifications.length === 1) { this._showNotification(); } },