1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-08 05:57:02 +09:00

pipe removed, transport moved to ts->dispatcher

This commit is contained in:
Razor 2019-09-22 10:38:32 +03:00
parent 0a685d1941
commit 85f1b1758b
8 changed files with 131 additions and 171 deletions

View file

@ -1,8 +1,5 @@
const electron = require('electron');
const { app, BrowserWindow, ipcMain } = require('electron');
const spawn = require('child_process').spawn;
const protobuf = require('protobufjs');
const Pipe = require('./electron/pipe');
function createWindow () {
const { width, height } = electron.screen.getPrimaryDisplay().workAreaSize;
@ -21,28 +18,12 @@ function createWindow () {
};
let win = new BrowserWindow(param);
let pipe = null;
win.loadURL('http://localhost:8080');
//win.loadFile('dist/index.html');
ipcMain.on('appLoaded', () => {
console.log('appLoaded');
pipe = new Pipe((event) => {
try {
console.log('EVENT', typeof(event), event.constructor.name, event);
win.webContents.send('pipeEvent', event);
} catch (e) {
console.log(e);
};
});
pipe.start();
});
ipcMain.on('pipeCmd', (e, type, data) => {
if (pipe) {
pipe.write(type, data);
};
});
ipcMain.on('appClose', () => {