File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -180,9 +180,14 @@ export default {
180180 return
181181 }
182182
183- const filePicker = buildFilePicker (this .startPath , false )
183+ let filePath
184+ try {
185+ const filePicker = buildFilePicker (this .startPath , false )
186+ filePath = await filePicker .pick ()
187+ } catch {
188+ return
189+ }
184190
185- const filePath = await filePicker .pick ()
186191 if (filePath) {
187192 this .insertFromPath (filePath)
188193 }
Original file line number Diff line number Diff line change @@ -59,13 +59,13 @@ export function useLinkFile({
5959 * @param startPath path to start the file picker on
6060 */
6161async function pickFile ( startPath : string ) : Promise < Node | undefined > {
62- let filePicker
62+ let file
6363 try {
64- filePicker = buildFilePicker ( startPath )
64+ const filePicker = buildFilePicker ( startPath )
65+ file = await filePicker . pick ( )
6566 } catch {
6667 return
6768 }
68- const file = await filePicker . pick ( )
6969 const client = getClient ( )
7070 const result = ( await client . stat ( `${ defaultRootPath } ${ file } ` , {
7171 details : true ,
You can’t perform that action at this time.
0 commit comments