mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix circular dependency. Fix waiting for instance enabled.
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
1 parent
28b49cc8f2
commit
7052475703
3 files changed
+15
-8
No files matched your search
@@ -301,8 +301,18 @@ export class ExtensionLoader {
|
||||
return this.extensions.get(extId);
|
||||
}
|
||||
|
||||
public async instanceToBeEnabled(extId: LensExtensionId): Promise<void> {
|
||||
return when(() => this.instances.get(extId)?.isEnabled);
|
||||
public async waitForEnabled(name: string): Promise<void> {
|
||||
return when(() => {
|
||||
for (const instanceEntry of this.instances) {
|
||||
const [, extension ] = instanceEntry;
|
||||
|
||||
if (extension.manifest.name === name) {
|
||||
return extension.isEnabled;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user