Skip to content

Commit 16e150b

Browse files
committed
fix: layout is saved with "Save as Homebrew" (close #31)
1 parent 6e371aa commit 16e150b

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/main.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ export default class StatBlockPlugin extends Plugin {
8585
.getPlugin("obsidian-dice-roller")
8686
.getRoller(str, "statblock", true);
8787
return roller;
88-
8988
}
9089
get sorted() {
9190
if (!this._sorted.length)
@@ -438,8 +437,8 @@ export default class StatBlockPlugin extends Plugin {
438437
let layout =
439438
this.settings.layouts.find(
440439
(layout) =>
441-
layout.name == params?.layout ||
442-
layout.name == params?.statblock
440+
layout.name == toBuild?.layout ||
441+
layout.name == toBuild?.statblock
443442
) ?? this.defaultLayout;
444443

445444
let statblock = new StatBlockRenderer(

src/view/statblock.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ export default class StatBlockRenderer extends MarkdownRenderChild {
5050
return;
5151
this.plugin.saveMonster({
5252
...fastCopy(this.monster),
53-
source: "Homebrew"
53+
source: "Homebrew",
54+
layout: this.layout.name
5455
});
5556
});
5657

0 commit comments

Comments
 (0)