Code review changes

This commit is contained in:
Roxanne Skelly 2018-09-28 10:48:20 -07:00
parent 2f1f1d896c
commit 1aaaca4e6c
4 changed files with 21 additions and 21 deletions

View file

@ -945,7 +945,7 @@ Function HandlePostInstallOptions
Delete "$SMSTARTUP\@PRE_SANDBOX_CONSOLE_SHORTCUT_NAME@.lnk" Delete "$SMSTARTUP\@PRE_SANDBOX_CONSOLE_SHORTCUT_NAME@.lnk"
; make a startup shortcut in this user's current context ; 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 SetShellVarContext current
CreateShortCut "$SMSTARTUP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" CreateShortCut "$SMSTARTUP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@"

View file

@ -66,7 +66,7 @@ AccountInfo.prototype = {
case VariantTypes.USER_TYPE: case VariantTypes.USER_TYPE:
//user type //user type
var userTypeName = this._parseByteArray().toString('ascii').slice(0,-1); var userTypeName = this._parseByteArray().toString('ascii').slice(0,-1);
if (userTypeName == "DataServerAccountInfo") { if (userTypeName === "DataServerAccountInfo") {
return this._parseDataServerAccountInfo(); return this._parseDataServerAccountInfo();
} }
else { else {
@ -77,7 +77,7 @@ AccountInfo.prototype = {
}, },
_parseByteArray: function () { _parseByteArray: function () {
var length = this._parseUInt32(); var length = this._parseUInt32();
if (length == 0xffffffff) { if (length === 0xffffffff) {
return null; return null;
} }
var result = this.rawData.slice(this.parseOffset, this.parseOffset+length); var result = this.rawData.slice(this.parseOffset, this.parseOffset+length);
@ -91,7 +91,7 @@ AccountInfo.prototype = {
} }
// length in bytes; // length in bytes;
var length = this._parseUInt32(); var length = this._parseUInt32();
if (length == 0xFFFFFFFF) { if (length === 0xFFFFFFFF) {
return null; return null;
} }

View file

@ -15,9 +15,9 @@ const osType = os.type();
exports.getBuildInfo = function() { exports.getBuildInfo = function() {
var buildInfoPath = null; var buildInfoPath = null;
if (osType == 'Windows_NT') { if (osType === 'Windows_NT') {
buildInfoPath = path.join(path.dirname(process.execPath), 'build-info.json'); buildInfoPath = path.join(path.dirname(process.execPath), 'build-info.json');
} else if (osType == 'Darwin') { } else if (osType === 'Darwin') {
var contentPath = ".app/Contents/"; var contentPath = ".app/Contents/";
var contentEndIndex = __dirname.indexOf(contentPath); var contentEndIndex = __dirname.indexOf(contentPath);
@ -67,9 +67,9 @@ exports.startInterface = function(url) {
} }
exports.isInterfaceRunning = function(done) { exports.isInterfaceRunning = function(done) {
if (osType == 'Windows_NT') { if (osType === 'Windows_NT') {
var pInterface = new Process('interface', 'interface.exe'); var pInterface = new Process('interface', 'interface.exe');
} else if (osType == 'Darwin') { } else if (osType === 'Darwin') {
var pInterface = new Process('interface', 'interface'); var pInterface = new Process('interface', 'interface');
} }
return pInterface.isRunning(done); return pInterface.isRunning(done);
@ -78,13 +78,13 @@ exports.isInterfaceRunning = function(done) {
exports.getRootHifiDataDirectory = function(local) { exports.getRootHifiDataDirectory = function(local) {
var organization = buildInfo.organization; var organization = buildInfo.organization;
if (osType == 'Windows_NT') { if (osType === 'Windows_NT') {
if (local) { if (local) {
return path.resolve(osHomeDir(), 'AppData/Local', organization); return path.resolve(osHomeDir(), 'AppData/Local', organization);
} else { } else {
return path.resolve(osHomeDir(), 'AppData/Roaming', organization); return path.resolve(osHomeDir(), 'AppData/Roaming', organization);
} }
} else if (osType == 'Darwin') { } else if (osType === 'Darwin') {
return path.resolve(osHomeDir(), 'Library/Application Support', organization); return path.resolve(osHomeDir(), 'Library/Application Support', organization);
} else { } else {
return path.resolve(osHomeDir(), '.local/share/', organization); return path.resolve(osHomeDir(), '.local/share/', organization);

View file

@ -51,8 +51,8 @@ HifiNotification.prototype = {
var app = null; var app = null;
switch (this.type) { switch (this.type) {
case NotificationType.GOTO: case NotificationType.GOTO:
if (typeof(this.data) == "number") { if (typeof(this.data) === "number") {
if (this.data == 1) { if (this.data === 1) {
text = "You have " + this.data + " event invitation pending." text = "You have " + this.data + " event invitation pending."
} else { } else {
text = "You have " + this.data + " event invitations pending." text = "You have " + this.data + " event invitations pending."
@ -67,8 +67,8 @@ HifiNotification.prototype = {
break; break;
case NotificationType.PEOPLE: case NotificationType.PEOPLE:
if (typeof(this.data) == "number") { if (typeof(this.data) === "number") {
if (this.data == 1) { if (this.data === 1) {
text = this.data + " of your connections is online." text = this.data + " of your connections is online."
} else { } else {
text = this.data + " of your connections are online." text = this.data + " of your connections are online."
@ -83,8 +83,8 @@ HifiNotification.prototype = {
break; break;
case NotificationType.WALLET: case NotificationType.WALLET:
if (typeof(this.data) == "number") { if (typeof(this.data) === "number") {
if (this.data == 1) { if (this.data === 1) {
text = "You have " + this.data + " unread Wallet transaction."; text = "You have " + this.data + " unread Wallet transaction.";
} else { } else {
text = "You have " + this.data + " unread Wallet transactions."; text = "You have " + this.data + " unread Wallet transactions.";
@ -99,8 +99,8 @@ HifiNotification.prototype = {
break; break;
case NotificationType.MARKETPLACE: case NotificationType.MARKETPLACE:
if (typeof(this.data) == "number") { if (typeof(this.data) === "number") {
if (this.data == 1) { if (this.data === 1) {
text = this.data + " of your purchased items has an update available."; text = this.data + " of your purchased items has an update available.";
} else { } else {
text = this.data + " of your purchased items have updates available."; text = this.data + " of your purchased items have updates available.";
@ -124,7 +124,7 @@ HifiNotification.prototype = {
}, },
function (error, reason, metadata) { function (error, reason, metadata) {
if(_finished) { if(_finished) {
if (osType == 'Darwin') { if (osType === 'Darwin') {
setTimeout(_finished, OSX_CLICK_DELAY_TIMEOUT); setTimeout(_finished, OSX_CLICK_DELAY_TIMEOUT);
} else { } else {
_finished(); _finished();
@ -215,7 +215,7 @@ HifiNotifications.prototype = {
_showNotification: function () { _showNotification: function () {
var _this = this; var _this = this;
if (osType == 'Darwin') { if (osType === 'Darwin') {
this.pendingNotifications[0].show(function () { this.pendingNotifications[0].show(function () {
// For OSX // For OSX
// don't attempt to show the next notification // don't attempt to show the next notification
@ -238,7 +238,7 @@ HifiNotifications.prototype = {
}, },
_addNotification: function (notification) { _addNotification: function (notification) {
this.pendingNotifications.push(notification); this.pendingNotifications.push(notification);
if(this.pendingNotifications.length == 1) { if(this.pendingNotifications.length === 1) {
this._showNotification(); this._showNotification();
} }
}, },