optimize the delay issue of clicking the desktop icon to display the main interface.

This commit is contained in:
unknown 2024-01-13 09:50:48 +08:00
parent 90fdc9b8ac
commit af25b93004

View File

@ -55,6 +55,12 @@ if (!app.requestSingleInstanceLock()) {
// process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true'
app.whenReady().then(() => {
try {
// 禁止多开
const instanceLock = app.requestSingleInstanceLock();
if (!instanceLock) {
app.quit();
return;
}
// addon
global.addon = require("../../native/addon.node");
// 初始化数据
@ -78,12 +84,6 @@ app.whenReady().then(() => {
return;
}
}
// 禁止多开
const instanceLock = app.requestSingleInstanceLock();
if (!instanceLock) {
app.quit();
return;
}
// 初始化数据
classificationDataInit();
itemDataInit();