Skip to content

Commit

Permalink
Code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mclemente committed Oct 6, 2023
1 parent 459dae8 commit 6010808
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/module/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export default class PolyglotHooks {
metadata.find(".polyglot-message-language").remove();
metadata.append(button);
if (clickable) {
button.click(game.polyglot._onGlobeClick.bind(this));
button.on("click", game.polyglot._onGlobeClick.bind(this));
}
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/module/logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ export class Polyglot {
.toArray()
.map((m) => game.messages.get(m.dataset.messageId));
for (let i = messages.length - 1; i >= 0; i--) {
let message = messages[i];
const message = messages[i];
if (message && (message.type == CONST.CHAT_MESSAGE_TYPES.IC || this._isMessageTypeOOC(message.type))) {
let lang = message.getFlag("polyglot", "language");
const lang = message.getFlag("polyglot", "language");
if (lang) {
let unknown = !this.isLanguageknownOrUnderstood(lang);
if (game.user.isGM && !game.settings.get("polyglot", "runifyGM")) {
Expand All @@ -168,7 +168,9 @@ export class Polyglot {
globe.css({ color });
unknown = false;
}
if (unknown != message.polyglot_unknown) ui.chat.updateMessage(message);
if (unknown !== message.polyglot_unknown) {
ui.chat.updateMessage(message);
}
}
}
}
Expand Down

0 comments on commit 6010808

Please sign in to comment.