Skip to content

Commit

Permalink
fix: layout is saved with "Save as Homebrew" (close #31)
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed Jan 17, 2022
1 parent 6e371aa commit 16e150b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ export default class StatBlockPlugin extends Plugin {
.getPlugin("obsidian-dice-roller")
.getRoller(str, "statblock", true);
return roller;

}
get sorted() {
if (!this._sorted.length)
Expand Down Expand Up @@ -438,8 +437,8 @@ export default class StatBlockPlugin extends Plugin {
let layout =
this.settings.layouts.find(
(layout) =>
layout.name == params?.layout ||
layout.name == params?.statblock
layout.name == toBuild?.layout ||
layout.name == toBuild?.statblock
) ?? this.defaultLayout;

let statblock = new StatBlockRenderer(
Expand Down
3 changes: 2 additions & 1 deletion src/view/statblock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ export default class StatBlockRenderer extends MarkdownRenderChild {
return;
this.plugin.saveMonster({
...fastCopy(this.monster),
source: "Homebrew"
source: "Homebrew",
layout: this.layout.name
});
});

Expand Down

0 comments on commit 16e150b

Please sign in to comment.