Skip to content

Commit

Permalink
fix: Update Dice Roller integration
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed Sep 26, 2024
1 parent c6756ce commit 34a1a15
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@codemirror/lang-javascript": "^6.2.1",
"@codemirror/language": "^6.9.1",
"@codemirror/search": "^6.5.3",
"@javalent/dice-roller": "^10.5.7",
"@javalent/dice-roller": "^11.2.1",
"@javalent/fantasy-statblocks": "^4.4.0",
"@tsconfig/svelte": "^5.0.2",
"@types/node": "^20.6.3",
Expand Down
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ export default class InitiativeTracker extends Plugin {
watchers: Map<TFile, HomebrewCreature> = new Map();
getRoller(str: string) {
if (!this.canUseDiceRoller) return;
const roller = window.DiceRoller.getRollerSync(str, "statblock");
const roller = window.DiceRoller.getRoller(str, "statblock");
return roller as StackRoller;
}
get canUseDiceRoller() {
if (window.DiceRoller != null) {
if (!window.DiceRoller.getRollerSync) {
if (!window.DiceRoller.getRoller) {
new Notice(
"Please update Dice Roller to the latest version to use with Initiative Tracker."
);
Expand Down

0 comments on commit 34a1a15

Please sign in to comment.