Send message function

This commit is contained in:
2025-12-28 10:00:15 +01:00
parent 896841e1c0
commit 7eec07c931
6 changed files with 340 additions and 115 deletions

View File

@@ -1,10 +1,18 @@
mod chat;
mod home;
use tokio::sync::Mutex; // Wichtig für den State
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.plugin(tauri_plugin_opener::init())
.invoke_handler(tauri::generate_handler![home::fetch_nostr_posts])
// DIESE ZEILE HINZUGEFÜGT: Registriert den State für alle Commands
.manage(chat::NostrState(Mutex::new(None)))
.invoke_handler(tauri::generate_handler![
home::fetch_nostr_posts,
chat::send_nostr_message
])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}