replaced get modules ipc event handler with a two way handler

This commit is contained in:
2025-11-24 14:14:16 +01:00
parent b9657e1c95
commit 31ddddab6a
+26 -6
View File
@@ -82,7 +82,7 @@ electron.app.whenReady().then(createWindow);
// mainWindow.webContents.send("fuck", "worked uwu") // mainWindow.webContents.send("fuck", "worked uwu")
// }, 5000); // }, 5000);
electron.ipcMain.on("get_modules", async (event, args) => { ipcMain.handle('get-module-names', async () => {
let module_array = { let module_array = {
"ai_modules":[], "ai_modules":[],
"transcription_modules":[] "transcription_modules":[]
@@ -97,10 +97,30 @@ electron.ipcMain.on("get_modules", async (event, args) => {
break; break;
} }
}) })
console.log(module_array); // console.log(module_array);
return module_array
mainWindow.webContents.send("modules", module_array) });
})
// electron.ipcMain.on("get_modules", async (event, args) => {
// let module_array = {
// "ai_modules":[],
// "transcription_modules":[]
// }
// mapFunctions.forEach(e => {
// switch(e.type){
// case "llm":
// module_array.ai_modules.push({"name": e.name, "displayname": e.displayname})
// break;
// case "transcription":
// module_array.transcription_modules.push({"name": e.name, "displayname": e.displayname})
// break;
// }
// })
// console.log(module_array);
// mainWindow.webContents.send("modules", module_array)
// })
@@ -155,7 +175,7 @@ electron.ipcMain.on("file_submit", async (event, args) => {
// }) // })
// } // }
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }