@@ -281,38 +281,38 @@ export const FileManagementPage = () => {
281
281
} ;
282
282
283
283
// Open file
284
- // const handleOpenFile = async (file: FileData) => {
285
- // try {
286
- // // First save the file to a temporary location
287
- // if (!window.electron || !window.electron.saveFile || !window.electron.openFile) {
288
- // console.error("Electron API not available");
289
- // return;
290
- // }
284
+ const handleOpenFile = async ( file : FileData ) => {
285
+ try {
286
+ // First save the file to a temporary location
287
+ if ( ! window . electron || ! window . electron . saveFile || ! window . electron . openFile ) {
288
+ console . error ( "Electron API not available" ) ;
289
+ return ;
290
+ }
291
291
292
- // // Save file to temp location and then open it
293
- // const saveResult = await window.electron.saveFile(
294
- // file.data,
295
- // file.name,
296
- // file.type || 'application/octet-stream'
297
- // );
292
+ // Save file to temp location and then open it
293
+ const saveResult = await window . electron . saveFile (
294
+ file . data ,
295
+ file . name ,
296
+ file . type || 'application/octet-stream'
297
+ ) ;
298
298
299
- // if (!saveResult.success || !saveResult.filePath) {
300
- // if (!saveResult.canceled) {
301
- // console.error("Error saving file:", saveResult.error);
302
- // }
303
- // return;
304
- // }
299
+ if ( ! saveResult . success || ! saveResult . filePath ) {
300
+ if ( ! saveResult . canceled ) {
301
+ console . error ( "Error saving file:" , saveResult . error ) ;
302
+ }
303
+ return ;
304
+ }
305
305
306
- // // Now open the file with the default application
307
- // const openResult = await window.electron.openFile(saveResult.filePath);
306
+ // Now open the file with the default application
307
+ const openResult = await window . electron . openFile ( saveResult . filePath ) ;
308
308
309
- // if (!openResult.success) {
310
- // console.error("Error opening file:", openResult.error);
311
- // }
312
- // } catch (error) {
313
- // console.error("Error opening file:", error);
314
- // }
315
- // };
309
+ if ( ! openResult . success ) {
310
+ console . error ( "Error opening file:" , openResult . error ) ;
311
+ }
312
+ } catch ( error ) {
313
+ console . error ( "Error opening file:" , error ) ;
314
+ }
315
+ } ;
316
316
317
317
// Format file size
318
318
const formatFileSize = ( bytes : number ) : string => {
@@ -672,13 +672,13 @@ export const FileManagementPage = () => {
672
672
</ td >
673
673
< td className = "px-4 py-3" >
674
674
< div className = "flex items-center justify-center space-x-2" >
675
- { /* <button
675
+ < button
676
676
onClick = { ( ) => handleOpenFile ( file ) }
677
677
className = "p-2 rounded-md message-icon-btn"
678
678
title = { t ( "fileManagement.open" ) }
679
679
>
680
680
< FolderOpen size = { 16 } />
681
- </button> */ }
681
+ </ button >
682
682
< button
683
683
onClick = { ( ) => {
684
684
setSelectedFile ( file ) ;
0 commit comments