Apply suggestions from code review

Co-authored-by: David Rowe <david@ctrlaltstudio.com>
This commit is contained in:
kasenvr 2020-08-01 13:46:02 -04:00 committed by GitHub
parent b64c44f5ee
commit cc43112bf3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -628,7 +628,7 @@ function setVisible(_visible) {
function avatarJoinsDomain(sessionID) {
Script.setTimeout(function () {
var messageText = AvatarManager.getPalData([sessionID]).data[0].sessionDisplayName + " has joined."
var messageColor = {red: 122, green: 122, blue: 122};
var messageColor = { red: 122, green: 122, blue: 122 };
addToLog(messageText, "Notice", messageColor, "Domain");
@ -640,7 +640,7 @@ function avatarJoinsDomain(sessionID) {
Messages.sendLocalMessage(FLOOF_NOTIFICATION_CHANNEL, JSON.stringify({
sender: "(D)",
text: messageText,
colour: {text: messageColor}
colour: { text: messageColor }
}));
}
}, 500); // Wait 500ms for the avatar to load to properly get info about them.
@ -648,7 +648,7 @@ function avatarJoinsDomain(sessionID) {
function avatarLeavesDomain(sessionID) {
var messageText = AvatarManager.getPalData([sessionID]).data[0].sessionDisplayName + " has left."
var messageColor = {red: 122, green: 122, blue: 122};
var messageColor = { red: 122, green: 122, blue: 122 };
addToLog(messageText, "Notice", messageColor, "Domain");
@ -660,7 +660,7 @@ function avatarLeavesDomain(sessionID) {
Messages.sendLocalMessage(FLOOF_NOTIFICATION_CHANNEL, JSON.stringify({
sender: "(D)",
text: messageText,
colour: {text: messageColor}
colour: { text: messageColor }
}));
}
}

View file

@ -181,7 +181,7 @@ Controller.mousePressEvent.connect(function (event) {
var overlay = Overlays.getOverlayAtPoint({ x: event.x, y: event.y });
if (overlay) {
for (var i = 0; i < notificationList.length; i++) {
if (overlay == notificationList[i].id) {
if (overlay === notificationList[i].id) {
Overlays.deleteOverlay(notificationList[i].id)
Messages.sendMessage(MAIN_CHAT_APP_CHANNEL, JSON.stringify({
type: "ShowChatWindow",
@ -191,4 +191,4 @@ Controller.mousePressEvent.connect(function (event) {
}
});
Script.scriptEnding.connect(cleanUp);
Script.scriptEnding.connect(cleanUp);