1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Switch to using injectable for limiting side effect

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen 2022-05-09 12:50:44 +03:00
parent 2eb9ba5142
commit 0ae93ea5b6
No known key found for this signature in database
GPG Key ID: 8C6CFB2FFFE8F68A

View File

@ -3,16 +3,18 @@
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { autoUpdater } from "electron-updater"; import electronUpdaterInjectable from "./electron-updater.injectable";
const quitAndInstallUpdateInjectable = getInjectable({ const quitAndInstallUpdateInjectable = getInjectable({
id: "quit-and-install-update", id: "quit-and-install-update",
instantiate: () => () => { instantiate: (di) => {
autoUpdater.quitAndInstall(true, true); const electronUpdater = di.inject(electronUpdaterInjectable);
},
causesSideEffects: true, return () => {
electronUpdater.quitAndInstall(true, true);
};
},
}); });
export default quitAndInstallUpdateInjectable; export default quitAndInstallUpdateInjectable;