Skip to content

Commit

Permalink
Merge pull request #696 from txm3278/tminz-foundry-warnings
Browse files Browse the repository at this point in the history
Fix Foundry Deprecation warnings
  • Loading branch information
otigon authored Apr 9, 2024
2 parents 2928ab3 + 42fb2dd commit 2c587c2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/active-effects/handleActiveEffects.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function createActiveEffects(effect) {
debug("Failed to find the Token for the Active Effect")
return;
}
const aeNameField = effect.label + `${aeToken.id}`
const aeNameField = (effect.name ?? effect.label) + `${aeToken.id}`
const checkAnim = Sequencer.EffectManager.getEffects({ object: aeToken, name: aeNameField }).length > 0
if (checkAnim) {
debug("Animation is already present on the Token, returning.")
Expand Down Expand Up @@ -124,7 +124,7 @@ export async function toggleActiveEffects(effect, toggle) {
export async function checkConcentration(effect) {

// Check effect label and return if it is not equal to "concentrating"
const label = effect.label || "";
const label = (effect.name ?? effect.label) || "";
if (label.toLowerCase() !== "concentrating") { return; }

// Get Originating Item. If no Origin, return
Expand Down
2 changes: 1 addition & 1 deletion src/formApps/Menus/Components/copyitem/copyToFrom.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function copyToFrom(animation, item, autorecSettings, isAE) {
onPress: async () => {
if (!animation._data.isEnabled) { return; }

let name = isAE ? item.label : item.name;
let name = item.name ?? item.label;

const isInAutorec = isAE
? AAAutorecFunctions.singleMenuSearch(AAAutorecFunctions.sortAndFilterMenus(autorecSettings), AAAutorecFunctions.rinseName(name))
Expand Down
2 changes: 1 addition & 1 deletion src/system-handlers/findAnimation.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export async function handleItem(data) {
if (!data.item) { return; };

const item = data.item;
const itemName = !data.activeEffect || game.system.id === "pf2e" || game.system.id === "ptu" ? item.name : item.label;
const itemName = item.name ?? item.label;
const rinsedItemName = itemName ? AAAutorecFunctions.rinseName(itemName) : "noitem";

const ammoItem = data.ammoItem;
Expand Down
2 changes: 1 addition & 1 deletion src/system-handlers/workflow-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default class AAHandler {

this.item = data.ammoItem || data.item;
this.itemUuid = this.item?.uuid || uuidv4();
this.itemName = !this.isActiveEffect || this.systemId === "pf2e" ? this.item.name : this.item.label;
this.itemName = this.item.name ?? this.item.label;
this.rinsedName = data.rinsedName || this.itemName ? this.itemName.replace(/\s+/g, '').toLowerCase() : "";

this.reachCheck = data.reach || 0;
Expand Down

0 comments on commit 2c587c2

Please sign in to comment.