Оптимизация ядра, исправление гонки потоков при получении версии

This commit is contained in:
RoyceDa
2026-02-20 16:34:54 +02:00
parent f01ed34285
commit 2e18d489be
17 changed files with 196 additions and 101 deletions

34
lib/main/ipcs/ipcCore.ts Normal file
View File

@@ -0,0 +1,34 @@
import { app, ipcMain, shell } from "electron";
ipcMain.handle("ipcCore:getCoreVersion", () => {
return app.getVersion();
});
ipcMain.handle("ipcCore:getArch", () => {
return process.arch;
})
ipcMain.handle("ipcCore:getUserDir", () => {
const userDir = app.getPath("userData");
return userDir;
});
ipcMain.handle("ipcCore:getAppPath", () => {
return app.getAppPath();
});
ipcMain.handle("ipcCore:getDownloadsPath", () => {
return app.getPath("downloads");
});
ipcMain.handle('ipcCore:showItemInFolder', (_, fullPath: string) => {
shell.showItemInFolder(fullPath);
});
ipcMain.handle('ipcCore:openExternal', (_, url: string) => {
shell.openExternal(url);
});
ipcMain.handle('ipcCore:getPlatform', () => {
return process.platform;
});