chore: Update dev run
All checks were successful
Queue Release Build / prepare (push) Successful in 20s
Deploy Web Apps / deploy (push) Successful in 9m11s
Queue Release Build / build-windows (push) Successful in 28m8s
Queue Release Build / build-linux (push) Successful in 46m49s
Queue Release Build / build-android (push) Successful in 20m54s
Queue Release Build / finalize (push) Successful in 2m15s
All checks were successful
Queue Release Build / prepare (push) Successful in 20s
Deploy Web Apps / deploy (push) Successful in 9m11s
Queue Release Build / build-windows (push) Successful in 28m8s
Queue Release Build / build-linux (push) Successful in 46m49s
Queue Release Build / build-android (push) Successful in 20m54s
Queue Release Build / finalize (push) Successful in 2m15s
This commit is contained in:
@@ -11,6 +11,7 @@ import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { DESKTOP_APP_DISPLAY_NAME } from '../app/desktop-branding.rules';
|
||||
import { readDesktopSettings } from '../desktop-settings';
|
||||
import { resolveDevelopmentClientUrl } from './dev-client-url.rules';
|
||||
|
||||
let mainWindow: BrowserWindow | null = null;
|
||||
let tray: Tray | null = null;
|
||||
@@ -277,11 +278,7 @@ export async function createWindow(): Promise<void> {
|
||||
}
|
||||
|
||||
if (process.env['NODE_ENV'] === 'development') {
|
||||
const devUrl = process.env['SSL'] === 'true'
|
||||
? 'https://localhost:4200'
|
||||
: 'http://localhost:4200';
|
||||
|
||||
await mainWindow.loadURL(devUrl);
|
||||
await mainWindow.loadURL(resolveDevelopmentClientUrl(process.env['SSL'] === 'true'));
|
||||
|
||||
if (process.env['DEBUG_DEVTOOLS'] === '1') {
|
||||
mainWindow.webContents.openDevTools();
|
||||
|
||||
26
electron/window/dev-client-url.rules.spec.ts
Normal file
26
electron/window/dev-client-url.rules.spec.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import {
|
||||
describe,
|
||||
expect,
|
||||
it
|
||||
} from 'vitest';
|
||||
|
||||
import {
|
||||
DEV_CLIENT_HOST,
|
||||
DEV_CLIENT_PORT,
|
||||
resolveDevelopmentClientUrl
|
||||
} from './dev-client-url.rules';
|
||||
|
||||
describe('dev-client-url.rules', () => {
|
||||
it('targets loopback IPv4 so dev wait-on avoids stale localhost IPv6 listeners', () => {
|
||||
expect(DEV_CLIENT_HOST).toBe('127.0.0.1');
|
||||
expect(DEV_CLIENT_PORT).toBe(4200);
|
||||
});
|
||||
|
||||
it('builds the HTTP dev client URL', () => {
|
||||
expect(resolveDevelopmentClientUrl(false)).toBe('http://127.0.0.1:4200');
|
||||
});
|
||||
|
||||
it('builds the HTTPS dev client URL', () => {
|
||||
expect(resolveDevelopmentClientUrl(true)).toBe('https://127.0.0.1:4200');
|
||||
});
|
||||
});
|
||||
8
electron/window/dev-client-url.rules.ts
Normal file
8
electron/window/dev-client-url.rules.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export const DEV_CLIENT_HOST = '127.0.0.1';
|
||||
export const DEV_CLIENT_PORT = 4200;
|
||||
|
||||
export function resolveDevelopmentClientUrl(sslEnabled: boolean): string {
|
||||
const scheme = sslEnabled ? 'https' : 'http';
|
||||
|
||||
return `${scheme}://${DEV_CLIENT_HOST}:${DEV_CLIENT_PORT}`;
|
||||
}
|
||||
Reference in New Issue
Block a user