diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 58af25e..019069d 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -40,7 +40,7 @@ import { import { Status, Item, SaveTo } from './types' import { SelectFiles, SelectFolder, ProcessFiles } from '../wailsjs/go/main/App' import { main } from '../wailsjs/go/models' -import { EventsOn } from '../wailsjs/runtime/runtime' +import { EventsOn, OnFileDrop } from '../wailsjs/runtime/runtime' const columnsDef: TableColumnDefinition[] = [ createTableColumn({ @@ -135,7 +135,7 @@ export const App = () => { for (const file of files) { setItems(prev => [...prev, { file, status: 'pending' }]) } - setTotalFilesNeedToProcess(files.length) + setTotalFilesNeedToProcess(prev => prev + files.length) }) } @@ -194,6 +194,14 @@ export const App = () => { } }, [finishedCount]) + OnFileDrop((_x, _y, paths) => { + for (const path of paths) { + setItems(prev => [...prev, { file: path, status: 'pending' }]) + } + console.log(paths.length, paths) + setTotalFilesNeedToProcess(prev => prev + paths.length) + }, false) + return (