Fixes to delete button

This commit is contained in:
Lncvrt committed 2026-04-15 12:35:50 -07:00
1 parent eec7f9365b
commit ef000a08cc
1 file changed
+9 -2
+9 -2
View File
@@ -184,7 +184,9 @@ export default function App () {
<FontAwesomeIcon <FontAwesomeIcon
icon={faTrashCan} icon={faTrashCan}
className='text-red-500/60 hover:text-red-500/75 transition-all hover:scale-110' className='text-red-500/60 hover:text-red-500/75 transition-all hover:scale-110'
onClick={async () => { onClick={async e => {
e.stopPropagation()
const response = await ask( const response = await ask(
`This ${ `This ${
f.is_dir ? 'folder' : 'file' f.is_dir ? 'folder' : 'file'
@@ -198,7 +200,12 @@ export default function App () {
kind: 'warning' kind: 'warning'
} }
) )
if (response) await invoke('remove_item', { path: f.path }) if (!response) return
await invoke('remove_item', { path: f.path })
setFiles(prev =>
prev.filter(x => !x.path.startsWith(f.path))
)
}} }}
/> />
</div> </div>