From 42aa72f3b812a0c2f97ed83efe477c1981c997a7 Mon Sep 17 00:00:00 2001
From: PandaDEV <70103896+0PandaDEV@users.noreply.github.com>
Date: Sat, 11 Jan 2025 00:32:58 +1000
Subject: [PATCH] refactor: replace lazy_static with OnceCell for hotkey
manager and registered hotkey
---
src-tauri/src/api/hotkeys.rs | 107 +++++++++++++++++------------------
1 file changed, 53 insertions(+), 54 deletions(-)
diff --git a/src-tauri/src/api/hotkeys.rs b/src-tauri/src/api/hotkeys.rs
index 994894b..a530b27 100644
--- a/src-tauri/src/api/hotkeys.rs
+++ b/src-tauri/src/api/hotkeys.rs
@@ -6,20 +6,20 @@ use global_hotkey::{
GlobalHotKeyManager,
HotKeyState,
};
-use lazy_static::lazy_static;
use std::str::FromStr;
use std::sync::Mutex;
-use tauri::{ AppHandle, Listener, Manager };
+use tauri::{ AppHandle, Manager, Listener };
use tauri_plugin_aptabase::EventTracker;
+use tokio::sync::OnceCell;
-lazy_static! {
- static ref HOTKEY_MANAGER: Mutex