mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-01-31 00:35:19 +01:00
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 cedb24d494
(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.
This commit is contained in:
@@ -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"
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user