debt - reduce usage of electron remote module

This commit is contained in:
Benjamin Pasero
2018-08-23 13:02:33 +02:00
parent 9a57f2e00b
commit 8f96ce69e2
8 changed files with 51 additions and 39 deletions

View File

@@ -7,7 +7,7 @@
const path = require('path');
const fs = require('fs');
const remote = require('electron').remote;
const ipc = require('electron').ipcRenderer;
function assign(destination, source) {
return Object.keys(source)
@@ -141,9 +141,9 @@ function main() {
window.addEventListener('keydown', function (e) {
const key = extractKey(e);
if (key === TOGGLE_DEV_TOOLS_KB) {
remote.getCurrentWebContents().toggleDevTools();
ipc.send('vscode:toggleDevTools');
} else if (key === RELOAD_KB) {
remote.getCurrentWindow().reload();
ipc.send('vscode:reloadWindow');
}
});

View File

@@ -198,7 +198,7 @@ export function startup(data: ProcessExplorerData): void {
applyZoom(data.zoomLevel);
// Map window process pids to titles, annotate process names with this when rendering to distinguish between them
ipcRenderer.on('windowsInfoResponse', (event, windows) => {
ipcRenderer.on('vscode:windowsInfoResponse', (event, windows) => {
mapPidToWindowTitle = new Map<number, string>();
windows.forEach(window => mapPidToWindowTitle.set(window.pid, window.title));
});