Skip to content
This repository was archived by the owner on Jun 16, 2025. It is now read-only.

Commit aca9a23

Browse files
committed
Add sleep after unregistering
1 parent 8155ac2 commit aca9a23

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Sidekick.Presentation.Blazor.Electron/Keybinds/KeybindProvider.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Threading;
23
using System.Threading.Tasks;
34
using MediatR;
45
using Microsoft.Extensions.DependencyInjection;
@@ -86,6 +87,7 @@ private Action GetKeybindAction<THandler>(string accelerator, string key)
8687
return () =>
8788
{
8889
ElectronNET.API.Electron.GlobalShortcut.Unregister(accelerator);
90+
Thread.Sleep(1);
8991

9092
var handler = serviceProvider.GetService<THandler>();
9193
if (handler.IsValid())
@@ -119,6 +121,7 @@ private Action GetChatKeybindAction(string accelerator, ChatSetting chat)
119121
return () =>
120122
{
121123
ElectronNET.API.Electron.GlobalShortcut.Unregister(accelerator);
124+
Thread.Sleep(1);
122125

123126
var handler = serviceProvider.GetService<ChatKeybindHandler>();
124127
if (handler.IsValid())

0 commit comments

Comments
 (0)