fix: trash integrity for TypeFile nodes — file record soft-delete, correct preview/restore
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user