mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-11 01:07:21 +00:00
Upgraded Tauri to v2.12.5 and fixed the zip security alerts (#1134)
This commit is contained in:
1 parent
bca728ba2c
commit
1c8b6ef774
7 files changed
+502
-433
No files matched your search
@@ -128,7 +128,7 @@ async fn share_file_on_platform(_path: PathBuf) -> Result<(), ShareFailure> {
|
||||
|
||||
#[cfg(windows)]
|
||||
async fn share_file_on_platform(path: PathBuf) -> Result<(), ShareFailure> {
|
||||
use std::cell::RefCell;
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::time::{Duration, Instant};
|
||||
use log::{debug, warn};
|
||||
use windows::ApplicationModel::DataTransfer::{DataPackage, DataRequestedEventArgs, DataTransferManager, ShareCompletedEventArgs};
|
||||
@@ -151,7 +151,7 @@ async fn share_file_on_platform(path: PathBuf) -> Result<(), ShareFailure> {
|
||||
fn provide_shared_file(arguments: &DataRequestedEventArgs, path: &str) -> windows::core::Result<()> {
|
||||
let request = arguments.Request()?;
|
||||
let lookup_started = Instant::now();
|
||||
let file = StorageFile::GetFileFromPathAsync(&HSTRING::from(path))?.get()?;
|
||||
let file = StorageFile::GetFileFromPathAsync(&HSTRING::from(path))?.join()?;
|
||||
let lookup_duration = lookup_started.elapsed();
|
||||
if lookup_duration > DATA_PACKAGE_DEADLINE {
|
||||
warn!(Source = "Share sheet"; "Looking up the shared file took {} ms, but Windows allows only {} ms to provide the data.", lookup_duration.as_millis(), DATA_PACKAGE_DEADLINE.as_millis());
|
||||
@@ -231,7 +231,10 @@ async fn share_file_on_platform(path: PathBuf) -> Result<(), ShareFailure> {
|
||||
// that lock.
|
||||
//
|
||||
let share_started = Instant::now();
|
||||
let mut data_requested = Some(data_requested_sender);
|
||||
|
||||
// Windows accepts only handlers which do not change what they captured, yet the first
|
||||
// request has to take the sender. The cell allows that through a shared reference:
|
||||
let data_requested = Cell::new(Some(data_requested_sender));
|
||||
let handler = TypedEventHandler::<DataTransferManager, DataRequestedEventArgs>::new(move |_, arguments| {
|
||||
let Some(arguments) = arguments.as_ref() else {
|
||||
return Ok(());
|
||||
|
||||
Reference in new issue
Block a user