Skip to content

Commit

Permalink
Fixes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Haxxer committed Sep 11, 2021
1 parent b7f5157 commit d3eb1c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Tagger {
static getTags(inObject) {
const relevantDocument = inObject?.document ?? inObject;
const tags = relevantDocument?.getFlag(this.MODULE_NAME, this.FLAG_NAME) ?? [];
return this._validateTags(tags);
return this._validateTags(tags, "getTags");
}

/**
Expand Down Expand Up @@ -208,7 +208,7 @@ class Tagger {

class TaggerConfig {

static _handleRenderFormApplication(app, html, options){
static _handleRenderFormApplication(app, html){
const found = configHandlers.find(config => app instanceof config.classType);
if (!found) return;
TaggerConfig[found.method](app, html, true);
Expand Down Expand Up @@ -238,7 +238,7 @@ class TaggerConfig {
if (!elem) return;

const tags = app?.object instanceof Actor
? Tagger._validateTags(getProperty(app?.object, "data.token.flags.tagger.tags"))
? Tagger._validateTags(getProperty(app?.object, "data.token.flags.tagger.tags") ?? [], "_applyHtml")
: Tagger.getTags(app?.object?._object);

const html = `
Expand All @@ -262,7 +262,7 @@ class TaggerConfig {
let propertyName = "flags.tagger.tags";
if(document instanceof Actor) propertyName = "token." + propertyName;
const tags = getProperty(updateData, propertyName);
if(tags) setProperty(updateData, propertyName, Tagger._validateTags(tags));
if(tags) setProperty(updateData, propertyName, Tagger._validateTags(tags, "_applyTags"));
}

}
Expand Down

0 comments on commit d3eb1c8

Please sign in to comment.