79443301

Date: 2025-02-16 14:29:15
Score: 0.5
Natty:
Report link

I want to clarify that I am not an expert in node.js and much less in electron, I am making this application for personal use and as I learn about the use of javascript focused on the backend with node.js, it is possible that I am not applying community conventions or best practices.

I have managed to get the solution in the following way:

await app.whenReady();
this.ipcController = new IpcController(
    this.windowManager,
    this.backendController,
    this.appConfig
);

this.mainWindow = await this.windowManager.createMainWindow();

this.ipcController.setMainWindow(this.mainWindow);

The new method in ipcController is:

setMainWindow(window) {
    this.windowManager.mainWindow = window;
}

With this order and logic, both the content handlers and those associated with interactions of the created window work correctly.

I think the answer I found only works for event control of rendered content so it is not a general solution.

Reasons:
  • RegEx Blacklisted phrase (1): I want
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Francisco IA Lover