mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-08 05:57:02 +09:00
merge
This commit is contained in:
commit
6703b2c8ca
125 changed files with 3068 additions and 304 deletions
25
electron.js
25
electron.js
|
@ -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) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue