mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Install missing extension if no extension route found and extension name is not installed
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
1 parent
6db52e70dd
commit
7a44a2ebc0
4 files changed
+60
-18
No files matched your search
@@ -84,6 +84,18 @@ export class ExtensionLoader {
|
||||
this.extensions.replace(extensions);
|
||||
}
|
||||
|
||||
isInstalled(name: string) {
|
||||
for (const extensionEntry of this.extensions) {
|
||||
const [, extension ] = extensionEntry;
|
||||
|
||||
if (extension.manifest.name === name) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
addExtension(extension: InstalledExtension) {
|
||||
this.extensions.set(extension.id, extension);
|
||||
}
|
||||
@@ -103,7 +115,6 @@ export class ExtensionLoader {
|
||||
} catch (error) {
|
||||
logger.error(`${logModule}: deactivation extension error`, { lensExtensionId, error });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
removeExtension(lensExtensionId: LensExtensionId) {
|
||||
|
||||
Reference in new issue
Block a user