Skip to content

Commit

Permalink
fix inline button not rendering on load
Browse files Browse the repository at this point in the history
  • Loading branch information
shabegom committed Aug 8, 2021
1 parent cf68f04 commit f326b8b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "buttons",
"name": "Buttons",
"description": "Create Buttons in your Obsidian notes to run commands, open links, and insert templates",
"version": "0.4.11",
"version": "0.4.12",
"author": "shabegom",
"authorUrl": "https://shbgm.ca",
"isDesktopOnly": false,
Expand Down
2 changes: 1 addition & 1 deletion src/button.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { App, Notice, MarkdownView } from "obsidian";
import { App, Notice, MarkdownView,} from "obsidian";
import { Arguments } from "./types";
import {
calculate,
Expand Down
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,12 @@ export default class ButtonsPlugin extends Plugin {
const text = codeblock.innerText.trim();
if (text.startsWith("button")) {
const id = text.split("button-")[1].trim();
setTimeout(async () => {
const args = await getButtonById(this.app, id);
if (args) {
ctx.addChild(new InlineButton(codeblock, this.app, args, id));
ctx.addChild(new InlineButton(codeblock, this.app, args, id))
}
}, 100);
}
}
});
Expand Down

0 comments on commit f326b8b

Please sign in to comment.