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:
parent
2eb9ba5142
commit
0ae93ea5b6
@ -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;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user