mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-06 12:54:16 +02:00
Replace implementation with shallow proxy
This commit is contained in:
parent
3d73a08ee0
commit
67d8d071a2
4 changed files with 22 additions and 28 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import DHBaseActorSettings from '../../applications/sheets/api/actor-setting.mjs';
|
||||
import DHItem from '../../documents/item.mjs';
|
||||
import { getScrollTextData } from '../../helpers/utils.mjs';
|
||||
import { createShallowProxy, getScrollTextData } from '../../helpers/utils.mjs';
|
||||
|
||||
const fields = foundry.data.fields;
|
||||
|
||||
|
|
@ -180,8 +180,7 @@ export default class BaseDataActor extends foundry.abstract.TypeDataModel {
|
|||
* @returns {object}
|
||||
*/
|
||||
getRollData() {
|
||||
const data = { ...this };
|
||||
return data;
|
||||
return createShallowProxy(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
import {
|
||||
addLinkedItemsDiff,
|
||||
getScrollTextData,
|
||||
shallowCopyWithGetters,
|
||||
createShallowProxy,
|
||||
updateLinkedItemApps
|
||||
} from '../../helpers/utils.mjs';
|
||||
import { ActionsField } from '../fields/actionField.mjs';
|
||||
|
|
@ -165,7 +165,7 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
|
|||
*/
|
||||
getRollData(options = {}) {
|
||||
const data = this.actor?.getRollData() ?? {};
|
||||
data.item = shallowCopyWithGetters(this);
|
||||
data.item = createShallowProxy(this);
|
||||
return data;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue