diff --git a/core/tauri/src/lib.rs b/core/tauri/src/lib.rs index e77e2ef19e90..e7902fcd61b6 100644 --- a/core/tauri/src/lib.rs +++ b/core/tauri/src/lib.rs @@ -827,7 +827,7 @@ pub trait Manager: sealed::ManagerBase { /// Gets the scope for the asset protocol. #[cfg(feature = "protocol-asset")] - fn asset_protocol_scope(&self) -> FsScope { + fn asset_protocol_scope(&self) -> scope::fs::Scope { self.state::().inner().asset_protocol.clone() } diff --git a/core/tauri/src/protocol/asset.rs b/core/tauri/src/protocol/asset.rs index 889b111bc916..449a8a03e5cf 100644 --- a/core/tauri/src/protocol/asset.rs +++ b/core/tauri/src/protocol/asset.rs @@ -2,9 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use crate::path::SafePathBuf; -use crate::scope::FsScope; -use crate::window::UriSchemeProtocolHandler; +use crate::{path::SafePathBuf, scope, window::UriSchemeProtocolHandler}; use http::{header::*, status::StatusCode, Request, Response}; use http_range::HttpRange; use rand::RngCore; @@ -14,7 +12,7 @@ use tauri_utils::mime_type::MimeType; use tokio::fs::File; use tokio::io::{AsyncReadExt, AsyncSeekExt, AsyncWriteExt}; -pub fn get(scope: FsScope, window_origin: String) -> UriSchemeProtocolHandler { +pub fn get(scope: scope::fs::Scope, window_origin: String) -> UriSchemeProtocolHandler { Box::new( move |request, responder| match get_response(request, &scope, &window_origin) { Ok(response) => responder.respond(response), @@ -31,7 +29,7 @@ pub fn get(scope: FsScope, window_origin: String) -> UriSchemeProtocolHandler { fn get_response( request: Request>, - scope: &FsScope, + scope: &scope::fs::Scope, window_origin: &str, ) -> Result>, Box> { // skip leading `/` diff --git a/examples/api/src-tauri/Cargo.lock b/examples/api/src-tauri/Cargo.lock index 8122282f5b5e..d5d2857f07e2 100644 --- a/examples/api/src-tauri/Cargo.lock +++ b/examples/api/src-tauri/Cargo.lock @@ -3555,7 +3555,6 @@ dependencies = [ "gtk", "http", "jni", - "rand 0.8.5", "raw-window-handle", "serde", "serde_json", @@ -3601,6 +3600,7 @@ dependencies = [ "infer 0.12.0", "json-patch", "kuchikiki", + "log", "memchr", "phf 0.10.1", "proc-macro2", diff --git a/examples/api/src-tauri/src/tray.rs b/examples/api/src-tauri/src/tray.rs index 698255061ca5..a81c54348338 100644 --- a/examples/api/src-tauri/src/tray.rs +++ b/examples/api/src-tauri/src/tray.rs @@ -101,7 +101,7 @@ pub fn create_tray(app: &tauri::AppHandle) -> tauri::Result<()> { _ => {} }) - .on_tray_event(|tray, event| { + .on_tray_icon_event(|tray, event| { if event.click_type == ClickType::Left { let app = tray.app_handle(); if let Some(window) = app.get_window("main") {