Skip to content

Commit c71d4a9

Browse files
Copilotcyanzhong
andauthored
Move preventDefault/stopPropagation after valid parentPath check
Agent-Logs-Url: https://github.com/MarkEdit-app/MarkEdit-preview/sessions/fd3c45a9-39c8-4dcd-995d-78325ff7b444 Co-authored-by: cyanzhong <6745066+cyanzhong@users.noreply.github.com>
1 parent ec61398 commit c71d4a9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/view.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ export function setUp() {
8585
return;
8686
}
8787

88-
event.preventDefault();
89-
event.stopPropagation();
90-
9188
const basePath = (await MarkEdit.getFileInfo())?.parentPath;
9289
if (basePath === undefined) {
9390
return;
9491
}
9592

93+
event.preventDefault();
94+
event.stopPropagation();
95+
9696
const absolutePath = joinPaths(basePath, href);
9797
await MarkEdit.openFile(absolutePath);
9898
});

0 commit comments

Comments
 (0)