feat: electron based app

This commit is contained in:
4gray committed 2020-08-23 20:57:07 +02:00
1 parent 2719d3932c
commit 998e7e9255
109 files changed
+13120 -6262

No files matched your search

+32 -4
View File
@@ -1,16 +1,44 @@
import { Component, NgZone } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { AppConfig } from '../environments/environment';
import { akitaDevtools } from '@datorama/akita';
import { environment } from 'src/environments/environment';
import { Titlebar, Color } from 'custom-electron-titlebar';
import { ElectronService } from './services/electron.service';
new Titlebar({
backgroundColor: Color.fromHex('#000'),
});
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
styleUrls: ['./app.component.scss'],
})
export class AppComponent {
constructor(private ngZone: NgZone) {
if (!environment.production) {
constructor(
private electronService: ElectronService,
private ngZone: NgZone,
private translate: TranslateService
) {
if (!AppConfig.production) {
akitaDevtools(ngZone);
}
this.translate.setDefaultLang('en');
console.log('AppConfig', AppConfig);
if (electronService.isElectron) {
console.log(process.env);
console.log('Run in electron');
console.log(
'Electron ipcRenderer',
this.electronService.ipcRenderer
);
console.log(
'NodeJS childProcess',
this.electronService.childProcess
);
} else {
console.log('Run in browser');
}
}
}