diff --git a/packages/compass/src/main/auto-update-manager.spec.ts b/packages/compass/src/main/auto-update-manager.spec.ts index 1953bca7f78..160e6ca5dc2 100644 --- a/packages/compass/src/main/auto-update-manager.spec.ts +++ b/packages/compass/src/main/auto-update-manager.spec.ts @@ -305,7 +305,7 @@ describe('CompassAutoUpdateManager', function () { it('should restart the app if user confirms', async function () { const restartToastIpcPrompt = sandbox - .stub(ipcMain!, 'broadcastFocused') + .stub(ipcMain!, 'broadcast') .callsFake((arg) => { expect(arg).to.equal('autoupdate:update-download-success'); setTimeout(() => { @@ -329,7 +329,7 @@ describe('CompassAutoUpdateManager', function () { it('should transition to restart dismissed if user does not confirm restart', async function () { const restartToastIpcPrompt = sandbox - .stub(ipcMain!, 'broadcastFocused') + .stub(ipcMain!, 'broadcast') .callsFake((arg) => { expect(arg).to.equal('autoupdate:update-download-success'); setTimeout(() => { diff --git a/packages/compass/src/main/auto-update-manager.ts b/packages/compass/src/main/auto-update-manager.ts index 2bc48cd7de5..ecb2062d135 100644 --- a/packages/compass/src/main/auto-update-manager.ts +++ b/packages/compass/src/main/auto-update-manager.ts @@ -359,7 +359,7 @@ const STATE_UPDATE: Record< this.maybeInterrupt(); if (isDownloadForManualCheck) { - ipcMain?.broadcastFocused('autoupdate:update-download-in-progress'); + ipcMain?.broadcast('autoupdate:update-download-in-progress'); } autoUpdater.checkForUpdates(); }, @@ -379,7 +379,7 @@ const STATE_UPDATE: Record< this.maybeInterrupt(); - ipcMain?.broadcastFocused('autoupdate:update-download-success'); + ipcMain?.broadcast('autoupdate:update-download-success'); }, }, [AutoUpdateManagerState.ManualDownload]: { @@ -431,7 +431,7 @@ const STATE_UPDATE: Record< [AutoUpdateManagerState.DownloadingError]: { nextStates: [AutoUpdateManagerState.UserPromptedManualCheck], enter: (_updateManager, _fromState, error) => { - ipcMain?.broadcastFocused('autoupdate:update-download-failed'); + ipcMain?.broadcast('autoupdate:update-download-failed'); log.error( mongoLogId(1001000129), 'AutoUpdateManager', @@ -663,12 +663,12 @@ class CompassAutoUpdateManager { this.setState(AutoUpdateManagerState.UserPromptedManualCheck); }); - ipcMain?.handle( + ipcMain?.on( 'autoupdate:update-download-restart-confirmed', this.handleIpcUpdateDownloadRestartConfirmed.bind(this) ); - ipcMain?.handle( + ipcMain?.on( 'autoupdate:update-download-restart-dismissed', this.handleIpcUpdateDownloadRestartDismissed.bind(this) );