We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cf5cfb4 commit eda7137Copy full SHA for eda7137
1 file changed
packages/app/src/pages/session/helpers.ts
@@ -24,13 +24,15 @@ export const createOpenReviewFile = (input: {
24
showAllFiles: () => void
25
tabForPath: (path: string) => string
26
openTab: (tab: string) => void
27
- loadFile: (path: string) => void
+ loadFile: (path: string) => any | Promise<void>
28
}) => {
29
return (path: string) => {
30
batch(() => {
31
input.showAllFiles()
32
- input.openTab(input.tabForPath(path))
33
- input.loadFile(path)
+ const maybePromise = input.loadFile(path)
+ const openTab = () => input.openTab(input.tabForPath(path))
34
+ if (maybePromise instanceof Promise) maybePromise.then(openTab)
35
+ else openTab()
36
})
37
}
38
0 commit comments