mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-23 02:49:55 +02:00
Handle erroring action update differently
This commit is contained in:
parent
7e5e722c5f
commit
e42d5ae4b3
2 changed files with 3 additions and 3 deletions
|
|
@ -255,7 +255,7 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2)
|
||||||
const submitData = this._prepareSubmitData(event, formData);
|
const submitData = this._prepareSubmitData(event, formData);
|
||||||
|
|
||||||
const data = foundry.utils.mergeObject(this.action.toObject(), submitData);
|
const data = foundry.utils.mergeObject(this.action.toObject(), submitData);
|
||||||
this.action = await this.action.update(data);
|
this.action = (await this.action.update(data)) ?? this.action;
|
||||||
|
|
||||||
this.sheetUpdate?.(this.action);
|
this.sheetUpdate?.(this.action);
|
||||||
this.render();
|
this.render();
|
||||||
|
|
|
||||||
|
|
@ -237,8 +237,8 @@ export function ActionMixin(Base) {
|
||||||
await this.parent.updateSource({ [path]: updates }, options);
|
await this.parent.updateSource({ [path]: updates }, options);
|
||||||
result = this.parent;
|
result = this.parent;
|
||||||
} else {
|
} else {
|
||||||
// If no changes occur, update returns undefined, but we need to re-retrieve the action anyways
|
result = await this.item.update({ [path]: updates }, options);
|
||||||
result = (await this.item.update({ [path]: updates }, options)) ?? this.item;
|
if (!result) return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.inCollection
|
return this.inCollection
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue