don't throw in case the tray was destroyed between calls

This commit is contained in:
rafael-aero
2021-09-03 15:28:32 +02:00
parent 14ee45b88f
commit 374d92f3b1
3 changed files with 18 additions and 18 deletions

View File

@@ -11,7 +11,7 @@ namespace ElectronNET.WebApp.Controllers
{
if(HybridSupport.IsElectronActive)
{
Electron.IpcMain.On("app-info", async (args) =>
Electron.IpcMain.OnWithId("app-info", async (id, args) =>
{
string appPath = await Electron.App.GetAppPathAsync();
@@ -19,7 +19,7 @@ namespace ElectronNET.WebApp.Controllers
Electron.IpcMain.Send(mainWindow, "got-app-path", appPath);
});
Electron.IpcMain.On("sys-info", async (args) =>
Electron.IpcMain.OnWithId("sys-info", async (id, args) =>
{
string homePath = await Electron.App.GetPathAsync(PathName.Home);
@@ -27,7 +27,7 @@ namespace ElectronNET.WebApp.Controllers
Electron.IpcMain.Send(mainWindow, "got-sys-info", homePath);
});
Electron.IpcMain.On("screen-info", async (args) =>
Electron.IpcMain.OnWithId("screen-info", async (id, args) =>
{
var display = await Electron.Screen.GetPrimaryDisplayAsync();