mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Broadcast event when update is complete
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
1 parent
b6d06c8ca3
commit
3ba60a47b0
4 files changed
+13
-5
No files matched your search
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
import { getInjectable, lifecycleEnum } from "@ogre-tools/injectable";
|
||||
import ipcRendererInjectable from "../../renderer/app-paths/get-value-from-registered-channel/ipc-renderer/ipc-renderer.injectable";
|
||||
import installFromInputInjectable from "../../renderer/components/+extensions/install-from-input/install-from-input.injectable";
|
||||
import extensionLoaderInjectable from "../extension-loader/extension-loader.injectable";
|
||||
import { BundledExtensionsUpdater } from "./bundled-extensions-updater";
|
||||
@@ -12,7 +13,8 @@ const bundledExtensionsUpdaterInjectable = getInjectable({
|
||||
instantiate: (di) =>
|
||||
new BundledExtensionsUpdater({
|
||||
installFromInput: di.inject(installFromInputInjectable),
|
||||
extensions: di.inject(extensionLoaderInjectable).bundledExtensions
|
||||
extensions: di.inject(extensionLoaderInjectable).bundledExtensions,
|
||||
ipcRenderer: di.inject(ipcRendererInjectable),
|
||||
}),
|
||||
|
||||
lifecycle: lifecycleEnum.singleton,
|
||||
|
||||
@@ -3,13 +3,14 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import { BundledExtensionsLoaded, ipcRendererOn } from "../../common/ipc"
|
||||
import { BundledExtensionsLoaded, BundledExtensionsUpdated, ipcRendererOn } from "../../common/ipc"
|
||||
import { logger } from "../common-api";
|
||||
import type { InstalledExtension } from "../extension-discovery/extension-discovery";
|
||||
import { ExtensionUpdater, UpdaterDependencies } from "./extension-updater";
|
||||
|
||||
interface Dependencies extends UpdaterDependencies {
|
||||
extensions: InstalledExtension[];
|
||||
ipcRenderer: { send: (name: string) => void };
|
||||
}
|
||||
|
||||
export class BundledExtensionsUpdater extends ExtensionUpdater {
|
||||
@@ -27,7 +28,11 @@ export class BundledExtensionsUpdater extends ExtensionUpdater {
|
||||
logger.info("[EXTENSIONS-UPDATER]: Bundled extensions update started.");
|
||||
|
||||
const updates = this.dependencies.extensions.map(this.update);
|
||||
await Promise.allSettled(updates);
|
||||
try {
|
||||
await Promise.allSettled(updates);
|
||||
} finally {
|
||||
this.dependencies.ipcRenderer.send(BundledExtensionsUpdated);
|
||||
}
|
||||
|
||||
logger.info("[EXTENSIONS-UPDATER]: Bundled extensions update finished.");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user