Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
darekf77 committed Jan 20, 2024
1 parent 4814b36 commit a9372ff
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"name": "Launch Server standalone",
"program": "${workspaceFolder}/run.js",
"args": [
"port=4505",
"port=4509",
"--ENVoverride=%7B%0A%20%20%20%20%22clientProjectName%22%3A%20%22static-columns%22%0A%7D "
],
"runtimeArgs": [
Expand Down
20 changes: 14 additions & 6 deletions src/app.electron.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@

import { CLIENT_DEV_NORMAL_APP_PORT, CLIENT_DEV_WEBSQL_APP_PORT } from './app.hosts';
import {
path,
//#region @backend
fse
//#endregion
} from 'tnp-core';
//#region @backend
import { app, BrowserWindow, screen } from 'electron';
import * as path from 'path';
import * as fs from 'fs';

let win: BrowserWindow | null = null;
const args = process.argv.slice(1),
serve = args.some(val => val === '--serve');
const args = process.argv.slice(1);
const serve = args.some(val => val === '--serve');
const websql = args.some(val => val === '--websql');

function createWindow(): BrowserWindow {

Expand All @@ -15,6 +22,7 @@ function createWindow(): BrowserWindow {
win = new BrowserWindow({
x: 0,
y: 0,
// autoHideMenuBar: true,
width: size.width / 2,
height: size.height / 2,
webPreferences: {
Expand All @@ -29,12 +37,12 @@ function createWindow(): BrowserWindow {
debug();

require('electron-reloader')(module);
win.loadURL('http://localhost:4200');
win.loadURL('http://localhost:' + (websql ? CLIENT_DEV_WEBSQL_APP_PORT : CLIENT_DEV_NORMAL_APP_PORT));
} else {
// Path when running electron executable
let pathIndex = './index.html';

if (fs.existsSync(path.join(__dirname, '../dist/index.html'))) {
if (fse.existsSync(path.join(__dirname, '../dist/index.html'))) {
// Path when running electron in local folder
pathIndex = '../dist/index.html';
}
Expand Down

0 comments on commit a9372ff

Please sign in to comment.