From 531446f38d8b8181c30540cb5fa48615fb767063 Mon Sep 17 00:00:00 2001 From: Gregor Biswanger Date: Fri, 10 Nov 2017 02:12:13 +0100 Subject: [PATCH] update demo code --- ElectronNET.WebApp/Controllers/ShortcutsController.cs | 3 ++- ElectronNET.WebApp/Views/Shortcuts/Index.cshtml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ElectronNET.WebApp/Controllers/ShortcutsController.cs b/ElectronNET.WebApp/Controllers/ShortcutsController.cs index 80a5628..246e229 100644 --- a/ElectronNET.WebApp/Controllers/ShortcutsController.cs +++ b/ElectronNET.WebApp/Controllers/ShortcutsController.cs @@ -1,6 +1,7 @@ using ElectronNET.API; using ElectronNET.API.Entities; using Microsoft.AspNetCore.Mvc; +using System.Threading.Tasks; namespace ElectronNET.WebApp.Controllers { @@ -21,7 +22,7 @@ namespace ElectronNET.WebApp.Controllers await Electron.Dialog.ShowMessageBoxAsync(options); }); - Electron.App.WillQuit += () => Electron.GlobalShortcut.UnregisterAll(); + Electron.App.WillQuit += () => Task.Run(() => Electron.GlobalShortcut.UnregisterAll()); } return View(); diff --git a/ElectronNET.WebApp/Views/Shortcuts/Index.cshtml b/ElectronNET.WebApp/Views/Shortcuts/Index.cshtml index b4e9e91..c7f363d 100644 --- a/ElectronNET.WebApp/Views/Shortcuts/Index.cshtml +++ b/ElectronNET.WebApp/Views/Shortcuts/Index.cshtml @@ -47,7 +47,7 @@ await Electron.Dialog.ShowMessageBoxAsync(options); }); -Electron.App.WillQuit += () => Electron.GlobalShortcut.UnregisterAll(); +Electron.App.WillQuit += () => Task.Run(() => Electron.GlobalShortcut.UnregisterAll());

ProTip