fix IDE updater commands (#872)

* fix IDE updater commands

* reinitialise autoupdate when preferences change

* fix typo + add i18n strings
This commit is contained in:
Alberto Iannaccone
2022-03-01 16:34:43 +00:00
committed by GitHub
parent a5a6a0b611
commit 96b5edf427
8 changed files with 110 additions and 102 deletions

View File

@@ -17,15 +17,7 @@ export class IDEUpdaterImpl implements IDEUpdater {
protected theiaFEClient?: IDEUpdaterClient;
protected clients: Array<IDEUpdaterClient> = [];
init(channel: UpdateChannel, baseUrl: string): void {
this.updater.autoDownload = false;
this.updater.channel = channel;
this.updater.setFeedURL({
provider: 'generic',
url: `${baseUrl}/${channel === UpdateChannel.Nightly ? 'nightly' : ''}`,
channel,
});
constructor() {
this.updater.on('checking-for-update', (e) => {
this.clients.forEach((c) => c.notifyCheckingForUpdate(e));
});
@@ -46,6 +38,16 @@ export class IDEUpdaterImpl implements IDEUpdater {
});
}
async init(channel: UpdateChannel, baseUrl: string): Promise<void> {
this.updater.autoDownload = false;
this.updater.channel = channel;
this.updater.setFeedURL({
provider: 'generic',
url: `${baseUrl}/${channel === UpdateChannel.Nightly ? 'nightly' : ''}`,
channel,
});
}
setClient(client: IDEUpdaterClient | undefined): void {
if (client) this.clients.push(client);
}