From 2088ee7ee50a4193d60fe62b38c0279124346f40 Mon Sep 17 00:00:00 2001 From: SrGooglo Date: Fri, 2 Feb 2024 16:36:34 +0100 Subject: [PATCH] exec on finish --- src/main/index.js | 8 ++++++-- .../src/components/PackageUpdateAvailable/index.jsx | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index fb97f27..d5a8c6f 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -45,8 +45,12 @@ class ElectronApp { "pkg:install": async (event, manifest) => { this.pkgManager.install(manifest) }, - "pkg:update": (event, manifest_id) => { - this.pkgManager.update(manifest_id) + "pkg:update": async (event, manifest_id, { execOnFinish = false } = {}) => { + await this.pkgManager.update(manifest_id) + + if(execOnFinish) { + await this.pkgManager.execute(manifest_id) + } }, "pkg:apply": (event, manifest_id, changes) => { this.pkgManager.applyChanges(manifest_id, changes) diff --git a/src/renderer/src/components/PackageUpdateAvailable/index.jsx b/src/renderer/src/components/PackageUpdateAvailable/index.jsx index 9f96e43..145b765 100644 --- a/src/renderer/src/components/PackageUpdateAvailable/index.jsx +++ b/src/renderer/src/components/PackageUpdateAvailable/index.jsx @@ -5,7 +5,9 @@ import "./index.less" const PackageUpdateAvailable = ({ update, close }) => { function handleUpdate() { - ipc.exec("pkg:update", update.manifest.id) + ipc.exec("pkg:update", update.manifest.id, { + execOnFinish: true + }) close() }