Skip to content

Commit

Permalink
fix: proper base href
Browse files Browse the repository at this point in the history
  • Loading branch information
darekf77 committed Apr 22, 2024
1 parent 737d7be commit d2f053c
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@
"projects": true,
"bin": true
}
}
}
1 change: 1 addition & 0 deletions projects/container-v4/isomorphic-lib-v4/app/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"baseHref": "/",
"assets": [
"src/favicon.ico",
"src/assets",
Expand Down
2 changes: 1 addition & 1 deletion projects/container-v4/isomorphic-lib-v4/app/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function init() {
// @ts-ignore
locateFile: file => {

const wasmPath = `${window.location.origin}${basename}/assets/${file}`;
const wasmPath = `${window.location.origin}${basename}assets/${file}`;
// console.log(`Trying to get sql.js wasm from: ${wasmPath}`)
return wasmPath;
// return `https://sql.js.org/dist/${file}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url('<<<TO_REPLACE_BASENAME>>>/assets/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2') format('woff2');
src: url('<<<TO_REPLACE_BASENAME>>>assets/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2') format('woff2');
}

.material-icons {
Expand Down
12 changes: 9 additions & 3 deletions src/app.electron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ function createWindow(): BrowserWindow {
},
});


if (serve) {
const debug = require('electron-debug');
debug();

require('electron-reloader')(module);
/* @removeStart */ require('electron-reloader')(module); /* @removeEnd */
win.webContents.openDevTools();

win.loadURL('http://localhost:' + (websql ? CLIENT_DEV_WEBSQL_APP_PORT : CLIENT_DEV_NORMAL_APP_PORT));
} else {
// Path when running electron executable
Expand Down Expand Up @@ -75,12 +77,16 @@ async function startElectron() {
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
// Added 400 ms to fix the black background issue while using transparent window. More detais at https://github.com/electron/electron/issues/15947
setTimeout(createWindow, 400)
// TOD maybe solution
// app.removeAllListeners('ready')

setTimeout(createWindow, 400)
//#region proper way that do not work
// app.on('ready', () => {
// // createWindow()
// createWindow()
// setTimeout(createWindow, 400)
// });
//#endregion

// Quit when all windows are closed.
app.on('window-all-closed', () => {
Expand Down
20 changes: 14 additions & 6 deletions src/lib/framework/framework-context-node-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export class FrameworkContextNodeApp extends FrameworkContextBase {
}

if (!this.connection.isInitialized && this.context.mode !== 'remote-backend') {
console.log(this.connection);
// console.log(this.connection);
Helpers.error(`Something wrong with connection init in ${this.context.mode}`, false, true);
}
log.info(`PREPARING TYPEORM CONNECTION DONE. initialize=${this.connection.isInitialized}`)
Expand Down Expand Up @@ -376,11 +376,19 @@ export class FrameworkContextNodeApp extends FrameworkContextBase {
if (!this.context.testMode) {
await Helpers.killProcessByPort(Number(this.context.uri.port), { silent: true });

h.listen(this.context.uri.port, () => {
Helpers.log(`Server listening on port: ${this.context.uri.port}, hostname: ${this.context.uri.pathname},
env: ${this.app.settings.env}
`);
});
if (
!(Helpers.isElectron &&
(this.context.mode === 'backend/frontend' || this.context.mode === 'websql/backend-frontend'))
) {
h.listen(this.context.uri.port, () => {
Helpers.log(`Server listening on port: ${this.context.uri.port}, hostname: ${this.context.uri.pathname},
env: ${this.app.settings.env}
`);
});
} else {
Helpers.info('Ipc communication enable instead express/http request');
}

}
//#endregion

Expand Down

0 comments on commit d2f053c

Please sign in to comment.