Skip to content

Commit

Permalink
fix: No need to use alternative getFile API (fix #416)
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed Jul 24, 2022
1 parent ec985d3 commit e3e4418
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5189,7 +5189,7 @@ function escapeRegex(string) {
return string.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
}

const getCurrFile = () => { var _a; return (_a = app.workspace.getActiveFile()) !== null && _a !== void 0 ? _a : app.workspace.getMostRecentlyActiveFile(); };
const getCurrFile = () => app.workspace.getActiveFile();
/**
* Get basename from a **Markdown** `path`
* @param {string} path
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/ObsidianUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type { MetaeditApi } from "../interfaces";
import type BCPlugin from "../main";
import { splitAndTrim } from "./generalUtils";

export const getCurrFile = (): TFile | null => app.workspace.getActiveFile() ?? app.workspace.getMostRecentlyActiveFile()
export const getCurrFile = (): TFile | null => app.workspace.getActiveFile()

/**
* Get basename from a **Markdown** `path`
Expand Down

0 comments on commit e3e4418

Please sign in to comment.