Skip to content

Commit

Permalink
update the window show time.
Browse files Browse the repository at this point in the history
  • Loading branch information
fuyoo committed Jul 15, 2024
1 parent 0b78b84 commit 2198dab
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
24 changes: 19 additions & 5 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
pub mod api;
#[cfg(not(target_os = "macos"))]
use tauri::Manager;
pub fn run() {
use tauri::RunEvent;

pub fn run() -> Result<(), Box<dyn std::error::Error>> {
let mut app = tauri::Builder::default();
// Access the system shell. Allows you to spawn child processes
// and manage files and URLs using their default application.
Expand All @@ -19,7 +20,20 @@ pub fn run() {
}
Ok(())
});
app.invoke_handler(tauri::generate_handler![api::request])
.run(tauri::generate_context!())
.expect("error while running tauri application");
let runner = app
.invoke_handler(tauri::generate_handler![api::request])
.build(tauri::generate_context!())?;
runner.run(|app, evt| match evt {
RunEvent::Exit => {}
RunEvent::ExitRequested { .. } => {}
RunEvent::WindowEvent { .. } => {}
RunEvent::Ready => match app.get_webview_window("main") {
None => {}
Some(win) => {
let _ = win.show();
}
},
_ => {}
});
Ok(())
}
2 changes: 1 addition & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

fn main() {
bsrdc::run();
let _ = bsrdc::run();
}
3 changes: 2 additions & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"minHeight": 600,
"center": true,
"hiddenTitle": true,
"titleBarStyle": "Overlay"
"titleBarStyle": "Overlay",
"visible": false
}
]
}
Expand Down

0 comments on commit 2198dab

Please sign in to comment.