diff --git a/arduino-ide-extension/src/electron-main/arduino-electron-main-module.ts b/arduino-ide-extension/src/electron-main/arduino-electron-main-module.ts index 537030925..cb203236a 100644 --- a/arduino-ide-extension/src/electron-main/arduino-electron-main-module.ts +++ b/arduino-ide-extension/src/electron-main/arduino-electron-main-module.ts @@ -18,7 +18,7 @@ import { IDEUpdaterClient, IDEUpdaterPath, } from '../common/protocol/ide-updater'; -import { IDEUpdaterImpl } from '../node/ide-updater/ide-updater-impl'; +import { IDEUpdaterImpl } from './ide-updater/ide-updater-impl'; export default new ContainerModule((bind, unbind, isBound, rebind) => { bind(ElectronMainApplication).toSelf().inSingletonScope(); diff --git a/arduino-ide-extension/src/node/ide-updater/ide-updater-impl.ts b/arduino-ide-extension/src/electron-main/ide-updater/ide-updater-impl.ts similarity index 82% rename from arduino-ide-extension/src/node/ide-updater/ide-updater-impl.ts rename to arduino-ide-extension/src/electron-main/ide-updater/ide-updater-impl.ts index e40dbd997..88e3bea1f 100644 --- a/arduino-ide-extension/src/node/ide-updater/ide-updater-impl.ts +++ b/arduino-ide-extension/src/electron-main/ide-updater/ide-updater-impl.ts @@ -18,6 +18,7 @@ export class IDEUpdaterImpl implements IDEUpdater { protected clients: Array = []; init(channel: UpdateChannel) { + this.updater.autoDownload = false; this.updater.channel = channel; this.updater.setFeedURL({ provider: 'generic', @@ -27,24 +28,24 @@ export class IDEUpdaterImpl implements IDEUpdater { channel, }); - this.updater.on('checking-for-update', (e) => - this.clients.forEach((c) => c.notifyCheckingForUpdate(e)) - ); - this.updater.on('update-available', (e) => - this.clients.forEach((c) => c.notifyUpdateAvailable(e)) - ); - this.updater.on('update-not-available', (e) => - this.clients.forEach((c) => c.notifyUpdateNotAvailable(e)) - ); - this.updater.on('download-progress', (e) => - this.clients.forEach((c) => c.notifyDownloadProgressChanged(e)) - ); - this.updater.on('update-downloaded', (e) => - this.clients.forEach((c) => c.notifyDownloadFinished(e)) - ); - this.updater.on('error', (e) => - this.clients.forEach((c) => c.notifyError(e)) - ); + this.updater.on('checking-for-update', (e) => { + this.clients.forEach((c) => c.notifyCheckingForUpdate(e)); + }); + this.updater.on('update-available', (e) => { + this.clients.forEach((c) => c.notifyUpdateAvailable(e)); + }); + this.updater.on('update-not-available', (e) => { + this.clients.forEach((c) => c.notifyUpdateNotAvailable(e)); + }); + this.updater.on('download-progress', (e) => { + this.clients.forEach((c) => c.notifyDownloadProgressChanged(e)); + }); + this.updater.on('update-downloaded', (e) => { + this.clients.forEach((c) => c.notifyDownloadFinished(e)); + }); + this.updater.on('error', (e) => { + this.clients.forEach((c) => c.notifyError(e)); + }); } setClient(client: IDEUpdaterClient | undefined): void { @@ -52,10 +53,8 @@ export class IDEUpdaterImpl implements IDEUpdater { } async checkForUpdates(): Promise { - const { - updateInfo, - cancellationToken, - } = await this.updater.checkForUpdates(); + const { updateInfo, cancellationToken } = + await this.updater.checkForUpdates(); this.cancellationToken = cancellationToken; if (this.updater.currentVersion.compare(updateInfo.version) === -1) {