From 43d6fff1a1ffd3dc07efcc0cb4174086fd955bb5 Mon Sep 17 00:00:00 2001 From: GeckoEidechse Date: Wed, 5 Oct 2022 14:04:47 +0200 Subject: feat: Add backend function to check if debug mode Useful for having different UI between dev and release --- src-tauri/src/main.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index a2866cb4..9cbef850 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -86,7 +86,8 @@ fn main() { verify_game_files_caller, get_enabled_mods_caller, set_mod_enabled_status_caller, - disable_all_but_core_caller + disable_all_but_core_caller, + is_debug_mode ]) .run(tauri::generate_context!()) .expect("error while running tauri application"); @@ -110,6 +111,12 @@ fn force_panic() { panic!("Force panicked!"); } +#[tauri::command] +/// Returns true if built in debug mode +fn is_debug_mode() -> bool { + return cfg!(debug_assertions); +} + #[tauri::command] /// Returns the current version number as a string fn get_version_number() -> String { -- cgit v1.2.3