mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 15:39:02 +01:00
deduplicate and simplify
This commit is contained in:
parent
598bf733f8
commit
b269e58585
4 changed files with 37 additions and 44 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import DHBaseItemSheet from '../api/base-item.mjs';
|
||||
import { copyAttachmentEffectsToActor, removeAttachmentEffectsFromActor } from '../../../helpers/attachmentHelper.mjs';
|
||||
import { copyAttachmentEffectsToActor, removeAttachmentFromItem } from '../../../helpers/attachmentHelper.mjs';
|
||||
|
||||
export default class ArmorSheet extends DHBaseItemSheet {
|
||||
/**@inheritdoc */
|
||||
|
|
@ -129,16 +129,9 @@ export default class ArmorSheet extends DHBaseItemSheet {
|
|||
* @param {HTMLElement} target - The clicked element
|
||||
*/
|
||||
static async #removeAttachment(event, target) {
|
||||
const uuid = target.dataset.uuid;
|
||||
const currentAttached = this.document.system.attached;
|
||||
|
||||
await this.document.update({
|
||||
'system.attached': currentAttached.filter(attachedUuid => attachedUuid !== uuid)
|
||||
});
|
||||
|
||||
await removeAttachmentEffectsFromActor({
|
||||
await removeAttachmentFromItem({
|
||||
parentItem: this.document,
|
||||
attachedUuid: uuid,
|
||||
attachedUuid: target.dataset.uuid,
|
||||
parentType: 'armor'
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue