Skip to content

Commit 5c4d0ac

Browse files
committed
Fix: Start/Stop command now correctly click the button in the note of active tab
1 parent 44ce896 commit 5c4d0ac

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,11 @@ export default class TimeTreePlugin extends Plugin {
115115
} else {
116116
new Notice("No active Markdown editor found.");
117117
}
118-
const btn = document.querySelector(
119-
".simple-time-tracker-btn"
120-
) as HTMLButtonElement | null;
118+
const btn = activeView
119+
? (activeView.containerEl.querySelector(
120+
".simple-time-tracker-btn"
121+
) as HTMLButtonElement | null)
122+
: null;
121123
if (btn) {
122124
btn.click();
123125
} else {

0 commit comments

Comments
 (0)