mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-13 20:21:06 +01:00
Improved item-identicial check
This commit is contained in:
parent
5d0a59bd12
commit
3c9bbf770c
2 changed files with 10 additions and 3 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import { itemIsIdentical } from '../../../helpers/utils.mjs';
|
||||
import DHBaseActorSettings from './actor-setting.mjs';
|
||||
import DHApplicationMixin from './application-mixin.mjs';
|
||||
|
||||
|
|
@ -248,9 +249,7 @@ export default class DHBaseActorSheet extends DHApplicationMixin(ActorSheetV2) {
|
|||
});
|
||||
}
|
||||
|
||||
const existingItem = this.document.items.find(
|
||||
x => x._stats.compendiumSource === actorItem._stats.compendiumSource
|
||||
);
|
||||
const existingItem = this.document.items.find(x => itemIsIdentical(x, dropDocument));
|
||||
if (existingItem) {
|
||||
cancel = true;
|
||||
await existingItem.update({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue