1 Star 0 Fork 2

minyuan/trilium

forked from lyu2026/trilium 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
electron.js 1.37 KB
一键复制 编辑 原始数据 按行查看 历史
zadam 提交于 2021-04-19 22:33 . support OPML from MindManager, fixes #1862
'use strict';
const {app, globalShortcut} = require('electron');
const sqlInit = require('./src/services/sql_init');
const appIconService = require('./src/services/app_icon');
const windowService = require('./src/services/window');
// Adds debug features like hotkeys for triggering dev tools and reload
require('electron-debug')();
appIconService.installLocalAppIcon();
require('electron-dl')({ saveAs: true });
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
else if (process.platform === 'win32') {
app.exit(0); // attempt to fix the issue when app.quite() won't terminate processes on windows
}
});
app.on('ready', async () => {
// app.setAppUserModelId('com.github.zadam.trilium');
// if db is not initialized -> setup process
// if db is initialized, then we need to wait until the migration process is finished
if (await sqlInit.isDbInitialized()) {
await sqlInit.dbReady;
await windowService.createMainWindow();
}
else {
await windowService.createSetupWindow();
}
await windowService.registerGlobalShortcuts();
});
app.on('will-quit', () => {
globalShortcut.unregisterAll();
});
// this is to disable electron warning spam in the dev console (local development only)
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true';
require('./src/www');
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/minyuan-fr/trilium.git
git@gitee.com:minyuan-fr/trilium.git
minyuan-fr
trilium
trilium
master

搜索帮助