mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Send LensMainExtension.nagivate calls to renderer before navigating (#3082)
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
dc2d7a08d3
commit
c3c944cd30
12 files changed
+100
-51
No files matched your search
@@ -21,7 +21,6 @@
|
||||
|
||||
import { LensExtension } from "./lens-extension";
|
||||
import { WindowManager } from "../main/window-manager";
|
||||
import { getExtensionPageUrl } from "./registries/page-registry";
|
||||
import { catalogEntityRegistry } from "../main/catalog";
|
||||
import type { CatalogEntity } from "../common/catalog";
|
||||
import type { IObservableArray } from "mobx";
|
||||
@@ -30,15 +29,8 @@ import type { MenuRegistration } from "./registries";
|
||||
export class LensMainExtension extends LensExtension {
|
||||
appMenus: MenuRegistration[] = [];
|
||||
|
||||
async navigate<P extends object>(pageId?: string, params?: P, frameId?: number) {
|
||||
const windowManager = WindowManager.getInstance();
|
||||
const pageUrl = getExtensionPageUrl({
|
||||
extensionId: this.name,
|
||||
pageId,
|
||||
params: params ?? {}, // compile to url with params
|
||||
});
|
||||
|
||||
await windowManager.navigate(pageUrl, frameId);
|
||||
async navigate(pageId?: string, params?: Record<string, any>, frameId?: number) {
|
||||
return WindowManager.getInstance().navigateExtension(this.id, pageId, params, frameId);
|
||||
}
|
||||
|
||||
addCatalogSource(id: string, source: IObservableArray<CatalogEntity>) {
|
||||
|
||||
Reference in new issue
Block a user