From 9fa12fb67b423c0bd37fb085463a7a223698970f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B7=B1=E7=A9=BA?= <2793500992@qq.com> Date: Sun, 27 Apr 2025 22:52:57 +0800 Subject: [PATCH] Fix Linter Error --- src/components/pages/FileManagementPage.tsx | 56 ++++++++++----------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/components/pages/FileManagementPage.tsx b/src/components/pages/FileManagementPage.tsx index 57af105..0de22b9 100644 --- a/src/components/pages/FileManagementPage.tsx +++ b/src/components/pages/FileManagementPage.tsx @@ -281,38 +281,38 @@ export const FileManagementPage = () => { }; // Open file - const handleOpenFile = async (file: FileData) => { - try { - // First save the file to a temporary location - if (!window.electron || !window.electron.saveFile || !window.electron.openFile) { - console.error("Electron API not available"); - return; - } +// const handleOpenFile = async (file: FileData) => { +// try { +// // First save the file to a temporary location +// if (!window.electron || !window.electron.saveFile || !window.electron.openFile) { +// console.error("Electron API not available"); +// return; +// } - // Save file to temp location and then open it - const saveResult = await window.electron.saveFile( - file.data, - file.name, - file.type || 'application/octet-stream' - ); +// // Save file to temp location and then open it +// const saveResult = await window.electron.saveFile( +// file.data, +// file.name, +// file.type || 'application/octet-stream' +// ); - if (!saveResult.success || !saveResult.filePath) { - if (!saveResult.canceled) { - console.error("Error saving file:", saveResult.error); - } - return; - } +// if (!saveResult.success || !saveResult.filePath) { +// if (!saveResult.canceled) { +// console.error("Error saving file:", saveResult.error); +// } +// return; +// } - // Now open the file with the default application - const openResult = await window.electron.openFile(saveResult.filePath); +// // Now open the file with the default application +// const openResult = await window.electron.openFile(saveResult.filePath); - if (!openResult.success) { - console.error("Error opening file:", openResult.error); - } - } catch (error) { - console.error("Error opening file:", error); - } - }; +// if (!openResult.success) { +// console.error("Error opening file:", openResult.error); +// } +// } catch (error) { +// console.error("Error opening file:", error); +// } +// }; // Format file size const formatFileSize = (bytes: number): string => {