1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-08 14:07:01 +09:00
This commit is contained in:
Andrew Simachev 2022-07-07 22:19:17 +03:00
parent 07c981c1ac
commit 7eecb38c60
6 changed files with 31 additions and 16 deletions

View file

@ -88,13 +88,6 @@ nativeTheme.on('updated', () => {
});
function createWindow () {
ipcMain.handle('Api', (e, cmd, args) => {
args = args || [];
args.unshift(e.sender);
Api[cmd].apply(Api, args);
});
mainWindow = WindowManager.createMain({ route: Util.getRouteFromUrl(deeplinkingUrl), isChild: false });
if (process.env.ELECTRON_DEV_EXTENSIONS) {
@ -130,6 +123,18 @@ function createWindow () {
MenuManager.setWindow(mainWindow);
MenuManager.initMenu();
MenuManager.initTray();
ipcMain.handle('Api', (e, cmd, args) => {
args = args || [];
args.unshift(BrowserWindow.fromId(e.sender.id));
const Api = require('./electron/js/api.js');
if (Api[cmd]) {
Api[cmd].apply(Api, args);
} else {
console.error('Api method not defined:', cmd, Api);
};
});
};
app.on('ready', () => {