fix resize event. fix emain communication to local-server (use 127.0.0.1 to force ipv4)

This commit is contained in:
sawka 2023-08-14 17:03:32 -07:00
parent d289026a98
commit 139639b990
2 changed files with 9 additions and 10 deletions

View File

@ -13,8 +13,8 @@ import {v4 as uuidv4} from "uuid";
const PromptAppPathVarName = "PROMPT_APP_PATH";
const PromptDevVarName = "PROMPT_DEV";
const AuthKeyFile = "prompt.authkey";
const DevServerEndpoint = "http://localhost:8090";
const ProdServerEndpoint = "http://localhost:1619";
const DevServerEndpoint = "http://127.0.0.1:8090";
const ProdServerEndpoint = "http://127.0.0.1:1619";
let isDev = (process.env[PromptDevVarName] != null);
let scHome = getPromptHomeDir();
@ -265,8 +265,8 @@ function createMainWindow(clientData) {
}
});
win.webContents.on("will-navigate", shNavHandler);
win.on("resized", debounce(400, mainResizeHandler));
win.on("moved", debounce(400, mainResizeHandler));
win.on("resized", debounce(400, (e) => mainResizeHandler(e, win)));
win.on("moved", debounce(400, (e) => mainResizeHandler(e, win)));
win.on("focus", () => {
wasInFg = true;
wasActive = true;
@ -292,8 +292,7 @@ function createMainWindow(clientData) {
return win;
}
function mainResizeHandler(e) {
let win = e.sender;
function mainResizeHandler(e, win) {
if (win == null || win.isDestroyed() || win.fullScreen) {
return;
}

View File

@ -19,10 +19,10 @@ dayjs.extend(localizedFormat)
var GlobalUser = "sawka";
const RemotePtyRows = 8; // also in main.tsx
const RemotePtyCols = 80;
const ProdServerEndpoint = "http://localhost:1619";
const ProdServerWsEndpoint = "ws://localhost:1623";
const DevServerEndpoint = "http://localhost:8090";
const DevServerWsEndpoint = "ws://localhost:8091";
const ProdServerEndpoint = "http://127.0.0.1:1619";
const ProdServerWsEndpoint = "ws://127.0.0.1:1623";
const DevServerEndpoint = "http://127.0.0.1:8090";
const DevServerWsEndpoint = "ws://127.0.0.1:8091";
const DefaultTermFontSize = 12;
const MinFontSize = 8;
const MaxFontSize = 15;