mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
add removeProtocolHandlers to LensExtension
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
97c50e50e4
commit
9f77b060c8
@ -56,6 +56,12 @@ export class LensExtension {
|
||||
lpr.extensionOn(this.id, pathSchema, handler);
|
||||
}
|
||||
|
||||
removeProtocolHandlers(): void {
|
||||
const lpr = LensProtocolRouter.getInstance<LensProtocolRouter>();
|
||||
|
||||
lpr.removeExtensionHandlers(this.id);
|
||||
}
|
||||
|
||||
get description() {
|
||||
return this.manifest.description;
|
||||
}
|
||||
|
||||
@ -186,6 +186,10 @@ export class LensProtocolRouter extends Singleton {
|
||||
this.extentionRoutes.get(id).set(urlSchema, handler);
|
||||
}
|
||||
|
||||
public removeExtensionHandlers(id: ExtensionId): void {
|
||||
this.extentionRoutes.get(id)?.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* onMissingExtension registers the handler for when an extension is missing
|
||||
* @param handler If the called handler resolves to true then the routes will be tried again
|
||||
|
||||
Loading…
Reference in New Issue
Block a user