Skip to content

Commit bc00cc2

Browse files
committed
refactor: remove async
1 parent b04ddf3 commit bc00cc2

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/engine/CaptureChoiceEngine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class CaptureChoiceEngine extends QuickAddChoiceEngine {
9090
}
9191

9292
if (this.choice.openFile && file) {
93-
const openExistingTab = await openExistingFileTab(this.app, file);
93+
const openExistingTab = openExistingFileTab(this.app, file);
9494

9595
if (!openExistingTab) {
9696
await openFile(this.app, file, {

src/engine/TemplateChoiceEngine.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,7 @@ export class TemplateChoiceEngine extends TemplateEngine {
147147
}
148148

149149
if (this.choice.openFile && createdFile) {
150-
const openExistingTab = await openExistingFileTab(
151-
this.app,
152-
createdFile,
153-
);
150+
const openExistingTab = openExistingFileTab(this.app, createdFile);
154151

155152
if (!openExistingTab) {
156153
await openFile(this.app, createdFile, {

src/utilityObsidian.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,10 @@ export async function openFile(
166166
/**
167167
* If there is no existing tab which opened the file, return false, else return true.
168168
*/
169-
export async function openExistingFileTab(
169+
export function openExistingFileTab(
170170
app: App,
171171
file: TFile,
172-
): Promise<boolean> {
172+
): boolean {
173173
let leaf: WorkspaceLeaf | undefined = undefined;
174174

175175
app.workspace.iterateRootLeaves((m_leaf: WorkspaceLeaf) => {

0 commit comments

Comments
 (0)