diff --git a/examples/vanilla/package.json b/examples/vanilla/package.json index 8c608e0..c5b8c30 100644 --- a/examples/vanilla/package.json +++ b/examples/vanilla/package.json @@ -4,11 +4,12 @@ "description": "", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "tauri": "tauri" }, "author": "", "license": "MIT", "dependencies": { - "@tauri-apps/cli": "^1.0.0-beta.10" + "@tauri-apps/cli": "^1.5.2" } } diff --git a/examples/vanilla/src-tauri/Cargo.toml b/examples/vanilla/src-tauri/Cargo.toml index 7a69f83..f396f39 100644 --- a/examples/vanilla/src-tauri/Cargo.toml +++ b/examples/vanilla/src-tauri/Cargo.toml @@ -10,11 +10,11 @@ rust-version = "1.56" [dependencies] serde_json = "1.0" serde = { version = "1.0", features = [ "derive" ] } -tauri = "1.0.0-rc.3" +tauri = { version = "1.5", features = [] } tauri-invoke-http = { path = "../../../" } [build-dependencies] -tauri-build = "1.0.0-rc.3" +tauri-build = { version = "1.5", features = [] } [features] default = [ "custom-protocol" ] diff --git a/examples/vanilla/src-tauri/src/main.rs b/examples/vanilla/src-tauri/src/main.rs index ddf0cff..b3a91b1 100644 --- a/examples/vanilla/src-tauri/src/main.rs +++ b/examples/vanilla/src-tauri/src/main.rs @@ -11,9 +11,9 @@ fn my_command(args: u64) -> Result { fn main() { let http = tauri_invoke_http::Invoke::new(if cfg!(feature = "custom-protocol") { - ["tauri://localhost"] + if cfg!(windows) { ["https://tauri.localhost"] } else { ["tauri://localhost"] } } else { - ["http://localhost:8080"] + ["http://127.0.0.1:1430"] }); tauri::Builder::default() .invoke_system(http.initialization_script(), http.responder()) diff --git a/examples/vanilla/src-tauri/tauri.conf.json b/examples/vanilla/src-tauri/tauri.conf.json index d8e2829..152fa89 100644 --- a/examples/vanilla/src-tauri/tauri.conf.json +++ b/examples/vanilla/src-tauri/tauri.conf.json @@ -20,29 +20,10 @@ "icons/icon.icns", "icons/icon.ico" ], - "resources": [], - "externalBin": [], "copyright": "", "category": "DeveloperTool", "shortDescription": "", - "longDescription": "", - "deb": { - "depends": [], - "useBootstrapper": false - }, - "macOS": { - "frameworks": [], - "minimumSystemVersion": "", - "useBootstrapper": false, - "exceptionDomain": "", - "signingIdentity": null, - "entitlements": null - }, - "windows": { - "certificateThumbprint": null, - "digestAlgorithm": "sha256", - "timestampUrl": "" - } + "longDescription": "" }, "updater": { "active": false diff --git a/src/lib.rs b/src/lib.rs index 740ac43..e3df077 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -55,7 +55,7 @@ impl Invoke { continue; } let url = request.url().to_string(); - let pieces = url.split("/").collect::>(); + let pieces = url.split('/').collect::>(); let window_label = pieces[1]; if let Some(window) = app.get_window(window_label) { @@ -73,7 +73,7 @@ impl Invoke { } else { unimplemented!() }; - let req_key = payload.callback.0.clone(); + let req_key = payload.callback.0; requests.lock().unwrap().insert(req_key, request); let _ = window.on_message(payload); } else {