From 0fd0a75218c5766212377db1e9f5a37d28a6d9cd Mon Sep 17 00:00:00 2001
From: AkiraFukushima
Date: Thu, 25 May 2023 00:16:00 +0900
Subject: [PATCH] Add feature to enable devtools
---
src-tauri/Cargo.toml | 2 ++
src-tauri/src/main.rs | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml
index f8a17529..024a9748 100644
--- a/src-tauri/Cargo.toml
+++ b/src-tauri/Cargo.toml
@@ -39,6 +39,8 @@ default = [ "custom-protocol" ]
# DO NOT remove this
custom-protocol = [ "tauri/custom-protocol" ]
+devtools = [ "tauri/devtools" ]
+
[package.metadata.i18n]
# The available locales for your application, default: ["en"].
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index 502cc192..b38d8952 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -384,7 +384,7 @@ async fn init_instruction(
#[tauri::command]
async fn switch_devtools(app_handle: AppHandle) -> () {
- #[cfg(debug_assertions)]
+ #[cfg(any(feature = "devtools", debug_assertions))]
{
let window = app_handle
.get_window("main")