Skip to content

Commit

Permalink
Merge pull request #4779 from foundryvtt/sidebar-render
Browse files Browse the repository at this point in the history
Fix some v13 errors. Respect options.render when calling PhysicalItemTemplate#_renderContainers.
  • Loading branch information
arbron authored Nov 25, 2024
2 parents d05005f + e460190 commit 4521419
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions module/data/item/templates/physical-item.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export default class PhysicalItemTemplate extends SystemDataModel {
// Render the actor sheet, compendium, or sidebar
if ( this.parent.isEmbedded ) this.parent.actor.sheet?.render(false, rendering);
else if ( this.parent.pack ) game.packs.get(this.parent.pack).apps.forEach(a => a.render(false, rendering));
else ui.sidebar.tabs.items.render(false, rendering);
else ui.items.render(false, rendering);

// Render former container if it was moved between containers
if ( formerContainer ) {
Expand All @@ -243,23 +243,23 @@ export default class PhysicalItemTemplate extends SystemDataModel {
/** @inheritDoc */
_onCreate(data, options, userId) {
super._onCreate(data, options, userId);
this._renderContainers();
if ( options.render !== false ) this._renderContainers();
}

/* -------------------------------------------- */

/** @inheritDoc */
_onUpdate(changed, options, userId) {
super._onUpdate(changed, options, userId);
this._renderContainers({ formerContainer: options.formerContainer });
if ( options.render !== false ) this._renderContainers({ formerContainer: options.formerContainer });
}

/* -------------------------------------------- */

/** @inheritDoc */
_onDelete(options, userId) {
super._onDelete(options, userId);
this._renderContainers();
if ( options.render !== false ) this._renderContainers();
}

/* -------------------------------------------- */
Expand Down

0 comments on commit 4521419

Please sign in to comment.