mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Pass updateChecker for LensExtension instances
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
1 parent
e69b8375c5
commit
f8476cff0b
4 files changed
+6
-5
No files matched your search
@@ -26,7 +26,7 @@ export class BundledVersionChecker implements LensExtensionLatestVersionChecker
|
||||
return null;
|
||||
}
|
||||
|
||||
const json = await this.getJson(extensionUpdateUrl);
|
||||
const json = await this.getJson(`${extensionUpdateUrl}/versions.json`);
|
||||
|
||||
if (!json || json.error || !json[manifest.name]) {
|
||||
logger.info(`[BUNDLED-EXTENSIONS-UPDATER]: No version found for ${manifest.name}.`);
|
||||
|
||||
+3
-2
@@ -8,11 +8,12 @@ import {
|
||||
LensExtensionDependencies,
|
||||
setLensExtensionDependencies,
|
||||
} from "../../lens-extension-set-dependencies";
|
||||
import type { LensExtensionUpdateChecker } from "../../lens-extension-update-checker";
|
||||
|
||||
export const createExtensionInstance =
|
||||
(dependencies: LensExtensionDependencies) =>
|
||||
(ExtensionClass: LensExtensionConstructor, extension: InstalledExtension) => {
|
||||
const instance = new ExtensionClass(extension);
|
||||
(ExtensionClass: LensExtensionConstructor, extension: InstalledExtension, updateChecker?: LensExtensionUpdateChecker) => {
|
||||
const instance = new ExtensionClass(extension, updateChecker);
|
||||
|
||||
instance[setLensExtensionDependencies](dependencies);
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ export class LensExtension {
|
||||
|
||||
|
||||
public async checkForUpdate() {
|
||||
return this.updateChecker?.run(this.manifest);
|
||||
return this.updateChecker?.run(this.manifest, this.isBundled);
|
||||
}
|
||||
|
||||
protected onActivate(): Promise<void> | void {
|
||||
|
||||
Reference in new issue
Block a user