mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-13 04:26:16 -08:00
refactor: minor code improvements
This commit is contained in:
1 parent
239022216c
commit
97fe6d9ebe
5 files changed
+92
-51
No files matched your search
+14
-10
@@ -8,6 +8,7 @@ import {
|
||||
EPG_ERROR,
|
||||
EPG_FETCH,
|
||||
EPG_FETCH_DONE,
|
||||
OPEN_FILE,
|
||||
SHOW_WHATS_NEW,
|
||||
VIEW_ADD_PLAYLIST,
|
||||
VIEW_SETTINGS,
|
||||
@@ -68,9 +69,10 @@ export class AppComponent {
|
||||
private snackBar: MatSnackBar,
|
||||
private whatsNewService: WhatsNewService
|
||||
) {
|
||||
/* if (
|
||||
(this.electronService.remote.process.platform === 'linux' ||
|
||||
this.electronService.remote.process.platform === 'win32') &&
|
||||
if (
|
||||
((this.electronService.isElectron &&
|
||||
this.electronService?.remote?.process.platform === 'linux') ||
|
||||
this.electronService?.remote?.process.platform === 'win32') &&
|
||||
this.electronService.remote.process.argv.length > 2
|
||||
) {
|
||||
const filePath = this.electronService.remote.process.argv.find(
|
||||
@@ -80,12 +82,12 @@ export class AppComponent {
|
||||
if (filePath) {
|
||||
const filePathsArray = filePath.split('/');
|
||||
const fileName = filePathsArray[filePathsArray.length - 1];
|
||||
this.electronService.sendIpcEvent('open-file', {
|
||||
this.electronService.sendIpcEvent(OPEN_FILE, {
|
||||
filePath,
|
||||
fileName,
|
||||
});
|
||||
}
|
||||
} */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -103,11 +105,13 @@ export class AppComponent {
|
||||
* Initializes all necessary listeners for the events from the renderer process
|
||||
*/
|
||||
setRendererListeners(): void {
|
||||
this.commandsList.forEach((command) =>
|
||||
this.electronService.listenOn(command.id, () =>
|
||||
this.ngZone.run(() => command.callback())
|
||||
)
|
||||
);
|
||||
if (this.electronService.isElectron) {
|
||||
this.commandsList.forEach((command) =>
|
||||
this.electronService.listenOn(command.id, () =>
|
||||
this.ngZone.run(() => command.callback())
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user