Skip to content

Commit

Permalink
remove potential bug with migrate scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
AngryBeaver committed Aug 31, 2024
1 parent b230c1c commit 2197354
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Changelog
## 4.0.3
- remove potential bug with migrate scripts.
- fix recipeSheet for systems without Formapplication e.g. a5e
## 4.0.1 + 4.0.2
- fix compatibility warnings for v14
## 4.0.0
Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"title": "Beaver's Crafting Module",
"description": "A Module for crafting, brewing, harvesting, mining, fabricating, gathering, character advancement, tech tree, skill tree, ability tree, downtime activities, factions / organisation reputation, quest logs, skill training",
"id": "beavers-crafting",
"version": "4.0.2",
"version": "4.0.3",
"authors": [
{
"name": "angryBeaver",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "beavers-crafting",
"title": "Beaver's Crafting",
"version": "4.0.2",
"version": "4.0.3",
"description": "Crafting",
"devDir": "c:\\vtts\\v12.331\\Data\\modules",
"#devDir": "c:\\vtts\\v11.315\\Data\\modules",
Expand Down
4 changes: 1 addition & 3 deletions src/Recipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@ export class Recipe implements RecipeData {
ors: {},
}
};
if(recipeTestsToBeaversTests(this)){
this.update();
}
recipeTestsToBeaversTests(this)
}

serialize(): RecipeData {
Expand Down
20 changes: 15 additions & 5 deletions src/apps/RecipeSheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ export class RecipeSheet {
return;
}
this.recipeElement = $('<div class="beavers-crafting recipe"></div>');
if(!this.app.form){
this.recipeElement = $('<form class="beavers-crafting recipe"></form>')
}
beaversSystemInterface.itemSheetReplaceContent(this.app,html,this.recipeElement);
this.recipe = Recipe.fromItem(this.item);
this.render().then(i=>this.addDragDrop());
Expand Down Expand Up @@ -127,13 +130,20 @@ export class RecipeSheet {
}

async update() {
const flags={};
flags[Settings.NAMESPACE] = {
let update={flags:{}};
update.flags[Settings.NAMESPACE] = {
recipe: this.recipe.serialize()
};
await this.item.update({
"flags": flags
});
if(!this.app.form){
const formData = new FormData(this.recipeElement[0]);
// @ts-ignore
for (const [key, value] of formData.entries()) {
setProperty(update,key,value);
}
}
await this.item.update(update);
this.recipe = Recipe.fromItem(this.item);

if(this.recipeElement) {
this.app.scrollToPosition = this.recipeElement.scrollTop();
}
Expand Down

0 comments on commit 2197354

Please sign in to comment.