Fix: Custom tray icon not working

1. Contains potential deadlock
This commit is contained in:
huzibaca
2024-09-20 16:26:23 +08:00
parent 414f9e9e96
commit dffd663d7a
6 changed files with 19 additions and 18 deletions

View File

@@ -44,7 +44,6 @@ pub fn app_home_dir() -> Result<PathBuf> {
.ok_or(anyhow::anyhow!("failed to get the portable app dir"))?;
return Ok(PathBuf::from(app_dir).join(".config").join(APP_ID));
}
let handle = handle::Handle::global();
let app_handle = handle.app_handle.lock().clone();
@@ -65,7 +64,7 @@ pub fn app_home_dir() -> Result<PathBuf> {
/// get the resources dir
pub fn app_resources_dir() -> Result<PathBuf> {
let handle = handle::Handle::global();
let app_handle = handle.app_handle.lock();
let app_handle = handle.app_handle.lock().clone();
if let Some(app_handle) = app_handle.as_ref() {
match app_handle.path().resource_dir() {
Ok(dir) => {