Continue polishing debug configurations

Signed-off-by: Alex Culliere <alozhkin@mirantis.com>
This commit is contained in:
Alex Culliere committed 2021-03-05 12:47:22 +02:00
1 parent faee13d4de
commit 05effb2395
4 files changed
+72 -3

No files matched your search

+13
View File
@@ -1,6 +1,7 @@
import "./components/app.scss";
import React from "react";
import { remote } from "electron";
import * as Mobx from "mobx";
import * as MobxReact from "mobx-react";
import * as ReactRouter from "react-router";
@@ -19,6 +20,17 @@ import { App } from "./components/app";
import { LensApp } from "./lens-app";
import { themeStore } from "./theme.store";
/**
* If this is a development buid, wait a second to attach
* Chrome Debugger to renderer process
* https://stackoverflow.com/questions/52844870/debugging-electron-renderer-process-with-vscode
*/
async function attachChromeDebugger() {
if (remote.process.defaultApp) {
await new Promise(r => setTimeout(r, 1000));
}
}
type AppComponent = React.ComponentType & {
init?(): Promise<void>;
};
@@ -75,3 +87,4 @@ export async function bootstrap(App: AppComponent) {
// run
bootstrap(process.isMainFrame ? LensApp : App);
attachChromeDebugger();