Оптимизация ядра, исправление гонки потоков при получении версии
This commit is contained in:
34
lib/main/ipcs/ipcCore.ts
Normal file
34
lib/main/ipcs/ipcCore.ts
Normal 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;
|
||||
});
|
||||
Reference in New Issue
Block a user