Skip to content

Commit

Permalink
Update hooks.js
Browse files Browse the repository at this point in the history
Fix #338.
  • Loading branch information
mclemente committed Nov 18, 2023
1 parent ff0dfc4 commit fdb562b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/module/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@ export default class PolyglotHooks {
}

static updateActor(actor, data, options, userId) {
if (actor.hasPlayerOwner) {
const owner = game.users.find((user) => user.character?.id === actor.id);
if (game.user.isGM || owner.id === userId) {
game.polyglot.updateUserLanguages(game.polyglot.chatElement);
game.polyglot.updateChatMessages();
}
if (actor.hasPlayerOwner && actor.testUserPermission(game.user, "OWNER")) {
game.polyglot.updateUserLanguages(game.polyglot.chatElement);
game.polyglot.updateChatMessages();
}
}

Expand Down

0 comments on commit fdb562b

Please sign in to comment.