refactor: code improvements

This commit is contained in:
4gray committed 2021-12-18 23:29:34 +01:00
1 parent cde7c0be09
commit fe5e7f2133
3 files changed
+6 -13

No files matched your search

+4 -3
View File
@@ -6,6 +6,7 @@ export const EPG_GET_PROGRAM = 'EPG:GET_PROGRAM';
export const EPG_GET_PROGRAM_DONE = 'EPG:GET_PROGRAM_DONE';
// Playlist related commands
export const PLAYLIST_GET_ALL = 'PLAYLIST:GET_ALL';
export const PLAYLIST_SAVE_DETAILS = 'PLAYLIST:SAVE_DETAILS';
export const PLAYLIST_PARSE = 'PLAYLIST:PARSE_PLAYLIST';
export const PLAYLIST_PARSE_RESPONSE = 'PLAYLIST:PARSE_PLAYLIST_RESPONSE';
@@ -15,11 +16,11 @@ export const PLAYLIST_UPDATE_POSITIONS = 'PLAYLIST:UPDATE_POSITIONS';
// General
export const SHOW_WHATS_NEW = 'SHOW_WHATS_NEW';
export const ERROR = 'error';
export const ERROR = 'ERROR';
// Channels
export const CHANNEL_SET_USER_AGENT = 'CHANNEL:SET_USER_AGENT';
// Views
export const VIEW_SETTINGS = 'settings-view';
export const VIEW_ADD_PLAYLIST = 'add-playlist-view';
export const VIEW_SETTINGS = 'VIEW:SETTINGS';
export const VIEW_ADD_PLAYLIST = 'VIEW:PLAYLISTS';
+1 -2
View File
@@ -5,7 +5,6 @@ import { ChannelStore, createChannel } from '../state';
import { Router } from '@angular/router';
import { MatSnackBar } from '@angular/material/snack-bar';
import { Playlist } from '../../../shared/playlist.interface';
import { ElectronService } from '../services/electron.service';
import {
ERROR,
PLAYLIST_PARSE,
@@ -61,7 +60,7 @@ export class HomeComponent {
this.snackBar.open('Done! Playlist was removed.', null, {
duration: 2000,
});
// this.electronService.sendIpcEvent('playlists-all');
this.electronService.sendIpcEvent('playlists-all');
},
},
{
+1 -8
View File
@@ -31,13 +31,6 @@ export class ElectronService extends DataService {
/* this.webFrame = window.require('electron').webFrame */ // need to test whether remote is available
/* this.childProcess = window.require('child_process');
this.fs = window.require('fs'); */
// create custom title bar
/* new Titlebar({
backgroundColor: Color.fromHex('#000'),
itemBackgroundColor: Color.fromHex('#222'),
enableMnemonics: true,
}); */
}
}
@@ -54,7 +47,7 @@ export class ElectronService extends DataService {
* @param payload data payload
*/
sendIpcEvent(type: string, payload?: unknown): void {
this.sendIpcEvent(type, payload);
this.ipcRenderer.send(type, payload);
}
/**