Skip to content

Commit

Permalink
Reveal Active File activates the Leaf
Browse files Browse the repository at this point in the history
  • Loading branch information
Ozan Tellioglu committed Jun 22, 2024
1 parent 134dbe3 commit 6442b8b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/MainView/MainComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -355,10 +355,11 @@ export default function MainTreeComponent(props: MainTreeComponentProps) {
}, [ozFileList]);

// Custom Event Handler Function
function handleRevealFileEvent(evt: Event) {
async function handleRevealFileEvent(evt: Event) {
// @ts-ignore
const file: TFile = evt.detail.file;
if (file && file instanceof TFile) {
await plugin.openFileTreeLeaf(true);
revealFileInFileTree(FileTreeUtils.TFile2OZFile(file));
} else {
new Notice('File not found');
Expand Down

0 comments on commit 6442b8b

Please sign in to comment.