Skip to content

Commit

Permalink
some bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
p4535992 committed Jan 20, 2022
1 parent e819892 commit 92b5480
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions trigger.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ Hooks.once('setup', function () {
Hooks.once('ready', () => {
Hooks.on('renderJournalSheet', (app, html, options) => {
if (game.settings.get(TRIGGER_HAPPY_MODULE_NAME, 'enableEnrichHtml')) {
if (game.triggers.journals.filter((e) => e.id === options.document.id).length > 0) {
if (game.triggers?.journals?.filter((e) => e.id === options.document.id).length > 0) {
const htmlString = HTMLEnricherTriggers.enrichAll(html.find('.editor-content').html());
html.find('.editor-content').html(htmlString);
//HTMLEnricherTriggers.bindRichTextLinks(html);
Expand Down Expand Up @@ -343,8 +343,16 @@ export class TriggerHappy {
Hooks.on('canvasReady', this._onCanvasReady.bind(this));
Hooks.on('controlToken', this._onControlToken.bind(this));
Hooks.on('createJournalEntry', this._parseJournals.bind(this));
Hooks.on('updateJournalEntry', this._parseJournals.bind(this));
Hooks.on('deleteJournalEntry', this._parseJournals.bind(this));
Hooks.on('updateJournalEntry', (entityData, data) => {
if (game.triggers?.journals?.filter((e) => e.id === entityData.id).length > 0) {
this._parseJournals.bind(this);
}
});
Hooks.on('deleteJournalEntry', (entityData, data) => {
if (game.triggers?.journals?.filter((e) => e.id === entityData.id).length > 0) {
this._parseJournals.bind(this);
}
});
Hooks.on('preUpdateToken', this._onPreUpdateToken.bind(this));
Hooks.on('preUpdateWall', this._onPreUpdateWall.bind(this));
Hooks.on('renderSettingsConfig', this._parseJournals.bind(this)); // TODO maybe we don't need this anymore ???
Expand Down

0 comments on commit 92b5480

Please sign in to comment.