Skip to content

Commit

Permalink
hotfix engine
Browse files Browse the repository at this point in the history
  • Loading branch information
opengs committed Apr 6, 2024
1 parent c9fdcdd commit 34e9439
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src-electron/handlers/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,14 @@ export class ExecutionEngine {
}
}

public async setModuleToRun(module?: ModuleName) {
await this.stateLock.runExclusive(async () => {
const config = await this.getState()
config.moduleToRun = module
await this.setState(config)
})
}

public async startModule() {
if (this.runningModule != null) {
throw new Error(`Module ${this.runningModule.name} is already running`)
Expand Down Expand Up @@ -336,9 +344,7 @@ export function handleExecutionEngine(modules: Array<Distress | DB1000N | MHDDOS
})

ipcMain.handle('executionEngine:setModuleToRun', async (_e, module?: ModuleName) => {
const state = await engine.getState()
state.moduleToRun = module
await engine.setState(state)
await engine.setModuleToRun(module)
})

ipcMain.handle('executionEngine:listenForExecutionLog', async (e) => {
Expand Down

0 comments on commit 34e9439

Please sign in to comment.