Skip to content

Commit

Permalink
closes #723
Browse files Browse the repository at this point in the history
  • Loading branch information
Muttley committed Nov 29, 2024
1 parent fb308c6 commit 1b56c1b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# vX.X.X

## Bugs
* [#723] Cannot edit gems in a character's gem bag
* [#964] Unable to edit/modify active effects on Items

## Chores
Expand Down
12 changes: 7 additions & 5 deletions system/src/apps/GemBagSD.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,17 @@ export default class GemBagSD extends Application {
}

_getItemContextOptions() {
const canEdit = function(tr) {
const me = this;

const canEdit = function(element) {
let result = false;
const itemId = tr.data("item-id");
const itemId = element.data("item-id");

if (game.user.isGM) {
result = true;
}
else {
result = this.actor.items.find(item => item._id === itemId)
result = me.actor.items.find(item => item._id === itemId)
? true
: false;
}
Expand All @@ -127,8 +129,8 @@ export default class GemBagSD extends Application {
{
name: game.i18n.localize("SHADOWDARK.sheet.general.item_delete.title"),
icon: '<i class="fas fa-trash"></i>',
condition: tr => canEdit(tr),
callback: tr => {
condition: element => canEdit(element),
callback: element => {
const itemId = tr.data("item-id");
this._onItemDelete(itemId);
},
Expand Down

0 comments on commit 1b56c1b

Please sign in to comment.