mirror of
https://github.com/tauri-apps/tauri-plugin-upload.git
synced 2026-01-31 00:35:19 +01:00
refactor: only inject API IIFE script when withGlobalTauri is true (#1071)
* refactor: only inject API IIFE script when withGlobalTauri is true * fmt * update tauri Committed via a GitHub action: https://github.com/tauri-apps/plugins-workspace/actions/runs/8347963398 Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
This commit is contained in:
committed by
tauri-bot
parent
303c1b311b
commit
6946bc2c42
4
build.rs
4
build.rs
@@ -5,5 +5,7 @@
|
||||
const COMMANDS: &[&str] = &["download", "upload"];
|
||||
|
||||
fn main() {
|
||||
tauri_plugin::Builder::new(COMMANDS).build();
|
||||
tauri_plugin::Builder::new(COMMANDS)
|
||||
.global_api_script_path("./api-iife.js")
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
"LICENSE"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "2.0.0-beta.4"
|
||||
"@tauri-apps/api": "2.0.0-beta.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,14 +139,10 @@
|
||||
},
|
||||
"platforms": {
|
||||
"description": "Target platforms this permission applies. By default all platforms are affected by this permission.",
|
||||
"default": [
|
||||
"linux",
|
||||
"macOS",
|
||||
"windows",
|
||||
"android",
|
||||
"iOS"
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/Target"
|
||||
}
|
||||
|
||||
@@ -130,7 +130,6 @@ fn file_to_body(channel: Channel, file: File) -> reqwest::Body {
|
||||
|
||||
pub fn init<R: Runtime>() -> TauriPlugin<R> {
|
||||
PluginBuilder::new("upload")
|
||||
.js_init_script(include_str!("api-iife.js").to_string())
|
||||
.invoke_handler(tauri::generate_handler![download, upload])
|
||||
.build()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user