Fixes to delete button
This commit is contained in:
1 file changed
+9
-2
+9
-2
@@ -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>
|
||||||
|
|||||||
Reference in new issue
Block a user