Fixed the Download button in main

This commit is contained in:
MikeHughes-BIN
2025-12-16 16:26:45 +01:00
parent 11f9a02778
commit 95ac7256d4
+13 -9
View File
@@ -124,7 +124,8 @@ electron.ipcMain.handle('get-module-names', async () => {
// mainWindow.webContents.send("modules", module_array) // mainWindow.webContents.send("modules", module_array)
// }) // })
var globalArgs = {}
var globalFinalHtmlPath = ""
electron.ipcMain.on("file_submit", async (event, args) => { electron.ipcMain.on("file_submit", async (event, args) => {
try { try {
@@ -197,14 +198,14 @@ electron.ipcMain.on("file_submit", async (event, args) => {
console.log(`\n\n Running the LLM for Document Style ${args.document.type}`); console.log(`\n\n Running the LLM for Document Style ${args.document.type}`);
await mapFunctions.get("module-handler").function(args.document.module, { inputTranscriptPath: transcriptpath, documentTypePath: "./storage/documentType/" + templateFile, language: "en" }).then(resp => { await mapFunctions.get("module-handler").function(args.document.module, { inputTranscriptPath: transcriptpath, documentTypePath: "./storage/documentType/" + templateFile, language: "en" }).then(resp => {
console.log(resp); console.log(resp);
transcriptpath = resp globalFinalHtmlPath = resp
curstep++ curstep++
mainWindow.webContents.send("progress", { curstep: curstep, totalsteps: totalsteps }) mainWindow.webContents.send("progress", {curstep:curstep, totalsteps:totalsteps})
}).catch(err => { }).catch(err => {
mainWindow.webContents.send("error", err) mainWindow.webContents.send("error", err)
return return
}) })
// TODO actually implement this functionality // TODO actually implement this functionality
@@ -231,6 +232,9 @@ electron.ipcMain.on("file_submit", async (event, args) => {
} }
}) })
electron.ipcMain.on("file_download", async() => {
await mapFunctions.get("htmlDocumentConverter").convert({inputPath:globalFinalHtmlPath, format: globalArgs.document.outputType, showDialog: true});
})
let q = let q =