I’m not too familiar with TS syntax but it looks to me like you’re not actually passing a function into your executeModal
function.
I think you’re over complicating it by making an helper function for executeAsModal
- as you don’t do any logic within that function it’s a bit redundant to make two function calls.
Personally, I’d make a helper function that encapsulates the whole file open process:
async function openFile(file) {
await core.executeAsModal(async (file) => {
await app.open(file)
}
}