0.3.1-0-pre.2.fix.1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/apps/game-snake-poc-tauri/src/tauri.rs
|
||||
// version: 1
|
||||
// version: 2
|
||||
|
||||
//! Tauri runtime assembly and Web/Rust commands for the Snake Android POC.
|
||||
|
||||
@@ -24,9 +24,7 @@ fn configure_commands(builder: tauri::Builder<tauri::Wry>) -> tauri::Builder<tau
|
||||
return builder.invoke_handler(tauri::generate_handler![get_runtime_descriptor, frontend_ready]);
|
||||
}
|
||||
|
||||
/// Runs the Snake Tauri application.
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() -> std::result::Result<(), String> {
|
||||
fn run_runtime() -> std::result::Result<(), String> {
|
||||
let logging_guard = game_logging_lib::init_console_tracing();
|
||||
let _logging_guard = match logging_guard {
|
||||
std::result::Result::Ok(value) => value,
|
||||
@@ -63,3 +61,25 @@ pub fn run() -> std::result::Result<(), String> {
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/// Runs the Snake Tauri application on a desktop host.
|
||||
#[cfg(not(mobile))]
|
||||
pub fn run() -> std::result::Result<(), String> {
|
||||
return run_runtime();
|
||||
}
|
||||
|
||||
/// Runs the Snake Tauri application from Tauri's mobile entry point.
|
||||
#[cfg(mobile)]
|
||||
#[tauri::mobile_entry_point]
|
||||
pub fn run() {
|
||||
let result = run_runtime();
|
||||
if let std::result::Result::Err(error) = result {
|
||||
tracing::error!(
|
||||
target: "games::tauri::snake",
|
||||
action = "mobile_entrypoint_error",
|
||||
error = error.as_str(),
|
||||
"Snake Tauri mobile entry point terminated after a runtime error"
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user