1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-08 05:57:02 +09:00
This commit is contained in:
Andrew Simachev 2024-01-31 22:14:56 +01:00
commit 6703b2c8ca
No known key found for this signature in database
GPG key ID: 49A163D0D14E6FD8
125 changed files with 3068 additions and 304 deletions

View file

@ -7,6 +7,7 @@ const storage = require('electron-json-storage');
const port = process.env.SERVER_PORT;
const protocol = 'anytype';
const remote = require('@electron/remote/main');
const { installNativeMessagingHost } = require('./electron/js/lib/installNativeMessagingHost.js');
const binPath = fixPathForAsarUnpack(path.join(__dirname, 'dist', `anytypeHelper${is.windows ? '.exe' : ''}`));
// Fix notifications app name
@ -129,6 +130,8 @@ function createWindow () {
MenuManager.initMenu();
MenuManager.initTray();
installNativeMessagingHost();
ipcMain.removeHandler('Api');
ipcMain.handle('Api', (e, id, cmd, args) => {
const Api = require('./electron/js/api.js');
@ -167,18 +170,18 @@ app.on('second-instance', (event, argv) => {
deeplinkingUrl = argv.find((arg) => arg.startsWith(`${protocol}://`));
};
if (mainWindow) {
if (deeplinkingUrl) {
Util.send(mainWindow, 'route', Util.getRouteFromUrl(deeplinkingUrl));
};
if (mainWindow.isMinimized()) {
mainWindow.restore();
};
mainWindow.show();
mainWindow.focus();
if (!mainWindow || !deeplinkingUrl) {
return;
};
Util.send(mainWindow, 'route', Util.getRouteFromUrl(deeplinkingUrl));
if (mainWindow.isMinimized()) {
mainWindow.restore();
};
mainWindow.show();
mainWindow.focus();
});
app.on('before-quit', (e) => {