Skip to content

Commit 531446f

Browse files
update demo code
1 parent fdb026c commit 531446f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ElectronNET.WebApp/Controllers/ShortcutsController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using ElectronNET.API;
22
using ElectronNET.API.Entities;
33
using Microsoft.AspNetCore.Mvc;
4+
using System.Threading.Tasks;
45

56
namespace ElectronNET.WebApp.Controllers
67
{
@@ -21,7 +22,7 @@ public IActionResult Index()
2122
await Electron.Dialog.ShowMessageBoxAsync(options);
2223
});
2324

24-
Electron.App.WillQuit += () => Electron.GlobalShortcut.UnregisterAll();
25+
Electron.App.WillQuit += () => Task.Run(() => Electron.GlobalShortcut.UnregisterAll());
2526
}
2627

2728
return View();

ElectronNET.WebApp/Views/Shortcuts/Index.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
await Electron.Dialog.ShowMessageBoxAsync(options);
4848
});
4949

50-
Electron.App.WillQuit += () => Electron.GlobalShortcut.UnregisterAll();</code></pre>
50+
Electron.App.WillQuit += () => Task.Run(() => Electron.GlobalShortcut.UnregisterAll());</code></pre>
5151

5252
<div class="demo-protip">
5353
<h2>ProTip</h2>

0 commit comments

Comments
 (0)