Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
threeseed committed Apr 28, 2024
1 parent 682aaaf commit a5d155f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src-tauri/src/handler_welcome.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ use tauri::{AppHandle, Wry};
use crate::globals::{ONBOARDED, WELCOME_WINDOW};
use crate::handlers::database_core;
use crate::windows::init_main_window;

#[cfg(target_os = "macos")]
use crate::windows_mac;

#[tauri::command]
Expand Down Expand Up @@ -67,6 +69,8 @@ pub async fn complete_onboarding(app_handle: AppHandle<Wry>, allow_telemetry: bo
// Init main window
unsafe { ONBOARDED = true; }
init_main_window(app_handle.clone()).await.unwrap();

#[cfg(target_os = "macos")]
windows_mac::register_shortcut(app_handle.clone(), shortcut_key.to_string());
Ok(())
}
Expand Down
2 changes: 2 additions & 0 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ mod state;
mod system_tray;
mod windows;
mod windows_main;

#[cfg(target_os = "macos")]
mod windows_mac;

fn main() {
Expand Down
7 changes: 6 additions & 1 deletion src-tauri/src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ use tauri::{App, AppHandle, Manager};

use crate::globals::*;
use crate::system_tray::{disable_system_tray, enable_system_tray};
use crate::{windows_mac, windows_main};
use crate::windows_main;

#[cfg(target_os = "macos")]
use crate::windows_mac;

pub async fn create_windows(app: &mut App) -> Result<()> {
#[cfg(target_os = "macos")]
Expand Down Expand Up @@ -60,6 +63,8 @@ pub async fn create_windows(app: &mut App) -> Result<()> {
let shortcut_key = DATABASE_MANAGER.get().unwrap().core(move |c|
settings_get(c, "appearance_shortcut_key".to_string())
).await?.unwrap();

#[cfg(target_os = "macos")]
windows_mac::register_shortcut(app.handle(), shortcut_key.to_string());

enable_system_tray(app.handle()).unwrap();
Expand Down

0 comments on commit a5d155f

Please sign in to comment.