Add a way to open the item if it is a file

This commit is contained in:
Lncvrt committed 2026-04-15 15:11:29 -07:00
1 parent 72962af606
commit c339436d4c
2 files changed
+14 -6

No files matched your search

+11 -5
View File
@@ -2,13 +2,19 @@
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "Capability for the main window",
"windows": [
"main"
],
"windows": ["main"],
"permissions": [
"core:default",
"shell:default",
"dialog:default",
"opener:default"
"opener:default",
{
"identifier": "opener:allow-open-path",
"allow": [
{
"path": "**"
}
]
}
]
}
}
+3 -1
View File
@@ -12,7 +12,7 @@ import {
import { v5 as uuidv5 } from 'uuid'
import prettyBytes from 'pretty-bytes'
import { ask, message, open } from '@tauri-apps/plugin-dialog'
import { revealItemInDir } from '@tauri-apps/plugin-opener'
import { openPath, revealItemInDir } from '@tauri-apps/plugin-opener'
interface Disk {
name: string
@@ -186,7 +186,9 @@ export default function App () {
className='flex justify-between px-2 py-1 cursor-pointer bg-(--col2)/50 hover:bg-(--col4)/50 border border-(--col4)/50 hover:border-(--col6)/50 transition-colors rounded-lg'
onClick={() => {
if (f.is_dir) setCurrentPath(f.path)
else openPath(f.path)
}}
title={f.is_dir ? undefined : 'Click to open the file'}
>
<p>
<FontAwesomeIcon