Skip to content

Commit

Permalink
fix: Fixes issue where dice integration no longer works (close #398)
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed Apr 22, 2024
1 parent 73e6ea9 commit 447f8ab
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/view/Statblock.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
import Bar from "./ui/Bar.svelte";
import ColumnContainer from "./ui/ColumnContainer.svelte";
import { nanoid } from "src/util/util";
import { Bestiary } from "src/bestiary/bestiary";
import copy from "fast-copy";
const dispatch = createEventDispatcher();
Expand All @@ -38,23 +35,25 @@
const monsterStore = writable();
$: $monsterStore = monster;
$: maxColumns =
const maxColumns =
!isNaN(Number(monster.columns ?? layout.columns)) &&
Number(monster.columns ?? layout.columns) > 0
? Number(monster.columns ?? layout.columns)
: 2;
$: monsterColumnWidth = Number(`${monster.columnWidth}`.replace(/\D/g, ""));
$: columnWidth =
const monsterColumnWidth = Number(
`${monster.columnWidth}`.replace(/\D/g, "")
);
const columnWidth =
!isNaN(monsterColumnWidth ?? layout.columnWidth) &&
(monsterColumnWidth ?? layout.columnWidth) > 0
? monsterColumnWidth
: 400;
$: canExport = monster.export ?? plugin.settings.export;
$: canDice =
const canExport = monster.export ?? plugin.settings.export;
const canDice =
plugin.canUseDiceRoller && (monster.dice ?? plugin.settings.useDice);
$: canRender = monster.render ?? plugin.settings.renderDice;
const canRender = monster.render ?? plugin.settings.renderDice;
setContext<StatBlockPlugin>("plugin", plugin);
setContext<boolean>("tryToRenderLinks", plugin.settings.tryToRenderLinks);
Expand Down

0 comments on commit 447f8ab

Please sign in to comment.