1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2021-10-05 14:46:18 -04:00
parent 87babc8f2c
commit fe212ad313
2 changed files with 2 additions and 2 deletions

View File

@ -230,7 +230,7 @@ export abstract class CatalogEntity<
return this.metadata.name; return this.metadata.name;
} }
public abstract onRun(context: CatalogEntityActionContext): void | Promise<void>; public abstract onRun?(context: CatalogEntityActionContext): void | Promise<void>;
public abstract onContextMenuOpen(context: CatalogEntityContextMenuContext): void | Promise<void>; public abstract onContextMenuOpen(context: CatalogEntityContextMenuContext): void | Promise<void>;
public abstract onSettingsOpen(context: CatalogEntitySettingsContext): void | Promise<void>; public abstract onSettingsOpen(context: CatalogEntitySettingsContext): void | Promise<void>;
} }

View File

@ -237,7 +237,7 @@ export class CatalogEntityRegistry {
this.onBeforeRun(entity) this.onBeforeRun(entity)
.then(doOnRun => { .then(doOnRun => {
if (doOnRun) { if (doOnRun) {
return entity.onRun(catalogEntityRunContext); return entity.onRun?.(catalogEntityRunContext);
} else { } else {
logger.debug(`onBeforeRun for ${entity.getId()} returned false`); logger.debug(`onBeforeRun for ${entity.getId()} returned false`);
} }