1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

change internal hostname to app, revert spacing

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2021-01-27 10:00:12 -05:00
parent 2ee1d3d794
commit f97002828f
2 changed files with 99 additions and 99 deletions

View File

@ -26,7 +26,6 @@ import { InstalledExtension, extensionDiscovery } from "../extensions/extension-
import type { LensExtensionId } from "../extensions/lens-extension"; import type { LensExtensionId } from "../extensions/lens-extension";
import { installDeveloperTools } from "./developer-tools"; import { installDeveloperTools } from "./developer-tools";
import { filesystemProvisionerStore } from "./extension-filesystem"; import { filesystemProvisionerStore } from "./extension-filesystem";
import { bindBroadcastHandlers } from "../common/ipc";
import { LensProtocolRouterMain } from "./protocol-handler"; import { LensProtocolRouterMain } from "./protocol-handler";
const workingDir = path.join(app.getPath("appData"), appName); const workingDir = path.join(app.getPath("appData"), appName);
@ -56,16 +55,14 @@ if (!app.requestSingleInstanceLock()) {
app.exit(); app.exit();
} }
app app.on("second-instance", () => {
.on("second-instance", () => {
windowManager?.ensureMainWindow(); windowManager?.ensureMainWindow();
}) });
.on("ready", async () => {
app.on("ready", async () => {
logger.info(`🚀 Starting Lens from "${workingDir}"`); logger.info(`🚀 Starting Lens from "${workingDir}"`);
await shellSync(); await shellSync();
bindBroadcastHandlers();
powerMonitor.on("shutdown", () => { powerMonitor.on("shutdown", () => {
app.exit(); app.exit();
}); });
@ -138,15 +135,17 @@ app
setTimeout(() => { setTimeout(() => {
appEventBus.emit({ name: "service", action: "start" }); appEventBus.emit({ name: "service", action: "start" });
}, 1000); }, 1000);
}) });
.on("activate", (event, hasVisibleWindows) => {
app.on("activate", (event, hasVisibleWindows) => {
logger.info("APP:ACTIVATE", { hasVisibleWindows }); logger.info("APP:ACTIVATE", { hasVisibleWindows });
if (!hasVisibleWindows) { if (!hasVisibleWindows) {
windowManager?.initMainWindow(false); windowManager?.initMainWindow(false);
} }
}) });
.on("will-quit", (event) => {
app.on("will-quit", (event) => {
// Quit app on Cmd+Q (MacOS) // Quit app on Cmd+Q (MacOS)
logger.info("APP:QUIT"); logger.info("APP:QUIT");
appEventBus.emit({name: "app", action: "close"}); appEventBus.emit({name: "app", action: "close"});
@ -154,8 +153,9 @@ app
clusterManager?.stop(); // close cluster connections clusterManager?.stop(); // close cluster connections
return; // skip exit to make tray work, to quit go to app's global menu or tray's menu return; // skip exit to make tray work, to quit go to app's global menu or tray's menu
}) });
.on("open-url", (event, rawUrl) => {
app.on("open-url", (event, rawUrl) => {
// lens:// protocol handler // lens:// protocol handler
event.preventDefault(); event.preventDefault();

View File

@ -28,7 +28,7 @@ export class LensProtocolRouterMain extends proto.LensProtocolRouter {
logger.info(`${proto.LensProtocolRouter.LoggingPrefix}: routing ${url.toString()}`); logger.info(`${proto.LensProtocolRouter.LoggingPrefix}: routing ${url.toString()}`);
switch (url.host) { switch (url.host) {
case "internal": case "app":
return this._routeToInternal(url); return this._routeToInternal(url);
case "extension": case "extension":
return this._routeToExtension(url); return this._routeToExtension(url);