Closed BryanMwangi closed 6 months ago
You are using multiple tauri::generate_context!()
Try fix it:
- .run(tauri::generate_context!())
+ .run(ctx)
.expect("error while running tauri application");
You are right!! my bad. Thank you for helping. Amazing plug-in btw
I am quite new to rust and Tauri in general and I am not sure if I am using this plugin right. I just want to be able to dynamically change the app's theme, alongside the React theme as well. I keep getting this error and I am not sure why:
error: symbol
_EMBED_INFO_PLIST` is already defined --> src/main.rs:13:17= note: this error originates in the macro
$crate::embed_info_plist_bytes
which comes from the expansion of the macrotauri::generate_context
(in Nightly builds, run with -Z macro-backtrace for more info)`Here is what my main.rs file looks like:
`// Prevents additional console window on Windows in release, DO NOT REMOVE!!
![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use tauri::Manager; use window_vibrancy::{apply_blur, apply_vibrancy, NSVisualEffectMaterial}; use tauri_plugin_theme::ThemePlugin; // Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
[tauri::command]
fn greet(name: &str) -> String { format!("Hello, {}! You've been greeted from Rust!", name) }
fn main() { let mut ctx = tauri::generate_context!(); tauri::Builder::default() .plugin(ThemePlugin::init(ctx.config_mut())) .invoke_handler(tauri::generate_handler![greet]) .setup(|app| { let window = app.get_window("main").unwrap();
} `
I am using tauri_plugin_theme version "0.2.0" since I am still on tauri version= "1.5". Any assistance would be nice since I think it is a neat feature to dynamically change the whole app's theme and not just the React part only.