mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-19 08:20:30 +01:00
Fixed downtime config again
This commit is contained in:
parent
20dbd3804c
commit
b8786d981e
8 changed files with 105 additions and 45 deletions
|
|
@ -202,11 +202,21 @@ export function ActionMixin(Base) {
|
|||
}
|
||||
|
||||
async update(updates, options = {}) {
|
||||
const path = this.inCollection ? `system.${this.systemPath}.${this.id}` : `system.${this.systemPath}`,
|
||||
const isSetting = !this.parent.parent;
|
||||
const basePath = isSetting ? this.systemPath : `system.${this.systemPath}`;
|
||||
|
||||
const path = this.inCollection ? `${basePath}.${this.id}` : basePath;
|
||||
|
||||
let result = null;
|
||||
if (isSetting) {
|
||||
await this.parent.updateSource({ [path]: updates }, options);
|
||||
result = this.parent;
|
||||
} else {
|
||||
result = await this.item.update({ [path]: updates }, options);
|
||||
}
|
||||
return this.inCollection
|
||||
? foundry.utils.getProperty(result, `system.${this.systemPath}`).get(this.id)
|
||||
: foundry.utils.getProperty(result, `system.${this.systemPath}`);
|
||||
? foundry.utils.getProperty(result, basePath).get(this.id)
|
||||
: foundry.utils.getProperty(result, basePath);
|
||||
}
|
||||
|
||||
delete() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue