feat: enhance SyncService and MainActivity for better battery optimization and service reliability
All checks were successful
Build / check-version (push) Successful in 6s
Build / build-linux (push) Successful in 5m32s
Build / build-windows (push) Successful in 8m23s
Build / build-android (push) Successful in 11m26s
Build / create-release (push) Has been skipped

This commit is contained in:
2026-02-05 07:48:09 +11:00
parent 89b0da0854
commit ece77ccba6
3 changed files with 200 additions and 33 deletions

View File

@@ -213,9 +213,27 @@ pub fn run() {
.plugin(tauri_plugin_notification::init())
.plugin(tauri_plugin_deep_link::init())
.setup(|app| {
// Create the main window for mobile
// Mobile uses the bundled assets directly, not localhost
// Create the main window for mobile with navigation handler for external links
WebviewWindowBuilder::new(app, "main", WebviewUrl::default())
.on_navigation(|url| {
let url_str = url.as_str();
// Allow navigation to app resources and special protocols
if url_str.starts_with("tauri://")
|| url_str.starts_with("http://tauri.localhost")
|| url_str.starts_with("https://tauri.localhost")
|| url_str.starts_with("blob:")
|| url_str.starts_with("data:")
|| url_str.starts_with("about:")
{
return true;
}
// External URLs - open in default browser
if url_str.starts_with("http://") || url_str.starts_with("https://") {
let _ = tauri_plugin_opener::open_url(url_str, None::<&str>);
return false;
}
true
})
.build()?;
Ok(())
})