mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Relocate file to directory containing feature
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
1 parent
3ae4c67647
commit
2eb9ba5142
7 files changed
+29
-24
No files matched your search
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import electronUpdaterInjectable from "../electron-app/features/electron-updater.injectable";
|
||||
import packageJsonInjectable from "../../common/vars/package-json.injectable";
|
||||
|
||||
const isAutoUpdateEnabledInjectable = getInjectable({
|
||||
id: "is-auto-update-enabled",
|
||||
|
||||
instantiate: (di) => {
|
||||
const electronUpdater = di.inject(electronUpdaterInjectable);
|
||||
const packageJson = di.inject(packageJsonInjectable);
|
||||
|
||||
const isPublishConfigured = Object.keys(packageJson.build).includes("publish");
|
||||
|
||||
return () => {
|
||||
return electronUpdater.isUpdaterActive() && isPublishConfigured;
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
export default isAutoUpdateEnabledInjectable;
|
||||
Reference in new issue
Block a user