@@ -287,7 +287,7 @@ export function FileTreeTable(props: FileTreeTableProps) {
287287 selectedReducer ( { verb : "set" , ids : [ ] , isReset : true } ) ;
288288 } , [ props . fileTree . torrenthash , selectedReducer ] ) ;
289289
290- const onRowDoubleClick = useCallback ( ( row : FileDirEntry ) => {
290+ const onRowDoubleClick = useCallback ( ( row : FileDirEntry , reveal : boolean = false ) => {
291291 if ( TAURI ) {
292292 if ( props . downloadDir === undefined || props . downloadDir === "" ) return ;
293293 let path = props . downloadDir ;
@@ -296,7 +296,7 @@ export function FileTreeTable(props: FileTreeTableProps) {
296296 }
297297 path = path + row . fullpath + ( isDirEntry ( row ) ? "/" : "" ) ;
298298 path = pathMapFromServer ( path , serverConfig ) ;
299- invoke ( "shell_open" , { path } ) . catch ( ( e ) => {
299+ invoke ( "shell_open" , { path, reveal } ) . catch ( ( e ) => {
300300 notifications . show ( {
301301 title : "Error opening path" ,
302302 message : path ,
@@ -389,16 +389,16 @@ function FiletreeContextMenu(props: {
389389 setContextMenuInfo : ( i : ContextMenuInfo ) => void ,
390390 fileTree : CachedFileTree ,
391391 selected : string [ ] ,
392- onRowDoubleClick : ( row : FileDirEntry ) => void ,
392+ onRowDoubleClick : ( row : FileDirEntry , reveal : boolean ) => void ,
393393 setExpanded ?: ( state : boolean ) => void ,
394394 toggleFileSearchBox : ( ) => void ,
395395} ) {
396396 const { onRowDoubleClick } = props ;
397- const onOpen = useCallback ( ( ) => {
397+ const onOpen = useCallback ( ( reveal : boolean ) => {
398398 const [ path ] = [ ...props . selected ] ;
399399 const entry = props . fileTree . findEntry ( path ) ;
400400 if ( entry === undefined ) return ;
401- onRowDoubleClick ( entry ) ;
401+ onRowDoubleClick ( entry , reveal ) ;
402402 } , [ onRowDoubleClick , props . fileTree , props . selected ] ) ;
403403
404404 const mutation = useMutateTorrent ( ) ;
@@ -459,11 +459,17 @@ function FiletreeContextMenu(props: {
459459 < ContextMenu contextMenuInfo = { props . contextMenuInfo } setContextMenuInfo = { props . setContextMenuInfo } >
460460 { TAURI && < >
461461 < Menu . Item
462- onClick = { onOpen }
462+ onClick = { ( ) => { onOpen ( false ) ; } }
463463 icon = { < Icon . BoxArrowUpRight size = "1.1rem" /> }
464464 disabled = { props . selected . length !== 1 } >
465465 < Text weight = "bold" > Open</ Text >
466466 </ Menu . Item >
467+ < Menu . Item
468+ onClick = { ( ) => { onOpen ( true ) ; } }
469+ icon = { < Icon . Folder2Open size = "1.1rem" /> }
470+ disabled = { props . selected . length !== 1 } >
471+ < Text > Open folder</ Text >
472+ </ Menu . Item >
467473 < Menu . Divider />
468474 </ > }
469475 < Menu . Item
0 commit comments