Skip to content

Commit

Permalink
fix events are not called after app reload
Browse files Browse the repository at this point in the history
  • Loading branch information
OEvgeny committed Apr 10, 2023
1 parent ec3cc47 commit e581116
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Composer/packages/client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ export const App: React.FC = () => {
performAppCleanupOnQuit();
});

ipcRenderer?.send('app-init');
ipcRenderer?.on('machine-info', (_event, info) => {
setMachineInfo(info);
});

ipcRenderer?.on('oneauth-state', (_event, enabled) => {
setOneAuthEnabled(enabled);
});
Expand Down
8 changes: 5 additions & 3 deletions Composer/packages/electron-server/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,11 @@ async function run() {
if (process.env.COMPOSER_DEV_TOOLS) {
mainWindow?.webContents.openDevTools();
}

mainWindow?.webContents.send('machine-info', { id: machineId, os: os.platform() });
mainWindow?.webContents.send('oneauth-state', isOneAuthEnabled);
// @ts-expect-error
mainWindow?.webContents.on('app-init', () => {
mainWindow?.webContents.send('machine-info', { id: machineId, os: os.platform() });
mainWindow?.webContents.send('oneauth-state', isOneAuthEnabled);
});
});

// Quit when all windows are closed.
Expand Down

0 comments on commit e581116

Please sign in to comment.