refactor: only inject API IIFE script when withGlobalTauri is true (#1071)

* refactor: only inject API IIFE script when withGlobalTauri is true

* fmt

* update tauri
This commit is contained in:
Lucas Fernandes Nogueira
2024-03-19 15:03:20 -03:00
committed by GitHub
parent 9dec9605ed
commit a04ea2f382
80 changed files with 108 additions and 73 deletions
-1
View File
@@ -1 +0,0 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_CLI__=function(_){"use strict";return"function"==typeof SuppressedError&&SuppressedError,_.getMatches=async function(){return await async function(_,n={},e){return window.__TAURI_INTERNALS__.invoke(_,n,e)}("plugin:cli|cli_matches")},_}({});Object.defineProperty(window.__TAURI__,"cli",{value:__TAURI_PLUGIN_CLI__})}
-1
View File
@@ -51,7 +51,6 @@ fn cli_matches<R: Runtime>(_app: AppHandle<R>, cli: State<'_, Cli<R>>) -> Result
pub fn init<R: Runtime>() -> TauriPlugin<R, Config> {
Builder::new("cli")
.js_init_script(include_str!("api-iife.js").to_string())
.invoke_handler(tauri::generate_handler![cli_matches])
.setup(|app, api| {
app.manage(Cli(api));