From 7930dde85c7e8d4c0c2c582b40643cd63aad24c5 Mon Sep 17 00:00:00 2001 From: WofWca Date: Sun, 16 Mar 2025 13:50:06 +0400 Subject: [PATCH] chore: examples: fix & simplify helloworld (#12995) Remove the cookies code from it. Firtly, they are not necessary: "Hello, world!" should be simple. Secondly, it's broken on Windows: `.cookies()` hangs. The cookies stuff was introduced recently, in cedb24d494b84111daa3206c05196c8b89f1e994 (https://github.com/tauri-apps/tauri/pull/12665). This commit reverts the changes to the example. This supersedes https://github.com/tauri-apps/tauri/pull/12992. --- examples/helloworld/main.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/examples/helloworld/main.rs b/examples/helloworld/main.rs index 91389db81..ee822803b 100644 --- a/examples/helloworld/main.rs +++ b/examples/helloworld/main.rs @@ -5,22 +5,13 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] #[tauri::command] -fn greet(app: tauri::AppHandle, name: String) -> String { - use tauri::Manager; - println!("greet {name}"); - let w = app.get_webview_window("main").unwrap(); - println!("{:?}", w.get_webview_window("main").unwrap().cookies()); +fn greet(name: &str) -> String { format!("Hello {name}, You have been greeted from Rust!") } fn main() { tauri::Builder::default() .invoke_handler(tauri::generate_handler![greet]) - .setup(|app| { - use tauri::Manager; - println!("{:?}", app.get_webview_window("main").unwrap().cookies()); - Ok(()) - }) .run(tauri::generate_context!( "../../examples/helloworld/tauri.conf.json" ))