1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman 2020-07-11 19:22:34 +03:00
parent 35f081eaf4
commit 62eb0fa592
2 changed files with 6 additions and 4 deletions

View File

@ -16,7 +16,10 @@ export interface IpcMessageHandler {
}
export function sendMessage(channel: IpcChannel, ...args: any[]) {
webContents.getFocusedWebContents().send(channel, ...args);
const webContent = webContents.getFocusedWebContents();
if (webContent) {
webContent.send(channel, ...args);
}
}
export async function invokeMessage(channel: IpcChannel, ...args: any[]) {

View File

@ -71,14 +71,13 @@ export class Cluster implements ClusterModel {
async init(proxyPort: number) {
try {
this.proxyPort = proxyPort;
this.contextHandler = new ContextHandler(this);
this.kubeconfigManager = new KubeconfigManager(this, this.contextHandler);
this.url = this.getKubeconfig().getCurrentCluster().server;
this.proxyUrl = `http://localhost:${proxyPort}`;
this.kubeProxyUrl = this.proxyUrl + apiKubePrefix;
this.webContentUrl = `http://${this.id}.localhost:${proxyPort}`;
this.contextHandler = new ContextHandler(this);
this.kubeconfigManager = new KubeconfigManager(this, this.contextHandler);
await this.refreshStatus();
this.initialized = true;