Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/uhk-agent/src/electron-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ async function createWindow() {
height: loadedWindowState.height,
webPreferences: {
contextIsolation: false,
nodeIntegration: true,
spellcheck: false,
preload: path.join(__dirname, 'preload.js')
},
Expand Down
4 changes: 4 additions & 0 deletions packages/uhk-agent/src/preload.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
const { ipcRenderer } = require('electron')

window.electron = {
ipcRenderer
}

ipcRenderer
.invoke('app-get-config', 'application-settings')
.then(appSettings => {
Expand Down
4 changes: 2 additions & 2 deletions packages/uhk-common/src/util/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ export function capitalizeFirstLetter(text: string): string {
return text.charAt(0).toUpperCase() + text.slice(1);
}

export function runInElectron() {
return window && (<any>window).process && (<any>window).process.type;
export function runInElectron(): boolean {
return !!(window as any)?.electron;
}
9 changes: 1 addition & 8 deletions packages/uhk-web/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,8 @@
},
"architect": {
"build": {
"builder": "@angular-builders/custom-webpack:browser",
"builder": "@angular-devkit/build-angular:browser",
"options": {
"customWebpackConfig": {
"path": "./webpack.config.js",
"mergeStrategies": {
"target": "replace",
"node": "replace"
}
},
"baseHref": "",
"optimization": false,
"sourceMap": true,
Expand Down
220 changes: 0 additions & 220 deletions packages/uhk-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/uhk-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"private": true,
"license": "See in LICENSE",
"devDependencies": {
"@angular-builders/custom-webpack": "20.0.0",
"@angular-devkit/build-angular": "20.3.25",
"@angular/animations": "20.3.19",
"@angular/cdk": "20.2.14",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { ipcRenderer } from 'electron';

import { ApplicationSettings, IpcEvents, UhkDeviceProduct, UserConfiguration } from 'uhk-common';
import { Observable, from, of } from 'rxjs';

import { DataStorageRepositoryService } from '../../app/services/datastorage-repository.service';

export class ElectronDataStorageRepositoryService extends DataStorageRepositoryService {
static async getValue(key: string): Promise<any> {
const value = await ipcRenderer.invoke(IpcEvents.app.getConfig, key);
const value = await (window as any).electron.ipcRenderer.invoke(IpcEvents.app.getConfig, key);
if (!value) {
return null;
}
Expand All @@ -16,7 +14,7 @@ export class ElectronDataStorageRepositoryService extends DataStorageRepositoryS
}

static async saveValue(key: string, value: any): Promise<null> {
await ipcRenderer.invoke(IpcEvents.app.setConfig, key, JSON.stringify(value));
await (window as any).electron.ipcRenderer.invoke(IpcEvents.app.setConfig, key, JSON.stringify(value));

return null;
}
Expand Down
Loading
Loading