fix: trash integrity for TypeFile nodes — file record soft-delete, correct preview/restore

This commit is contained in:
2026-06-05 17:31:18 +08:00
parent 64e6c6f735
commit a37afd3b67
7 changed files with 452 additions and 52 deletions
+5 -1
View File
@@ -1397,7 +1397,11 @@
previewError = ''
previewLoading = true
try {
previewContent = await wailsCall('ReadTrashFileContent', node.id) || ''
if (node.trashFsPath) {
previewContent = await wailsCall('ReadTrashFile', node.trashFsPath) || ''
} else {
previewContent = await wailsCall('ReadTrashFileContent', node.id) || ''
}
const ext = (node.title || '').split('.').pop().toLowerCase()
if (['png','jpg','jpeg','gif','webp','bmp','svg'].includes(ext)) {
previewContent = 'data:image/' + (ext === 'svg' ? 'svg+xml' : ext) + ';base64,' + btoa(previewContent)