mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-13 09:34:03 +00:00
[ENG-683] Fix tauri allow list (#897)
* Fix Tauri drag not working - Fix Mpeg videos compleatly breaking QuickPreview - Fix Dev build open data folder button not working - Fix MP4 videos freezing in QuickPreview on MacOS * Fix React inter-component state error
This commit is contained in:
parent
9584dbd924
commit
350b7e39db
41
Cargo.lock
generated
41
Cargo.lock
generated
|
@ -5028,6 +5028,16 @@ version = "0.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
|
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "open"
|
||||||
|
version = "3.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2078c0039e6a54a0c42c28faa984e115fb4c2d5bf2208f77d1961002df8576f8"
|
||||||
|
dependencies = [
|
||||||
|
"pathdiff",
|
||||||
|
"windows-sys 0.42.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "opener"
|
name = "opener"
|
||||||
version = "0.6.1"
|
version = "0.6.1"
|
||||||
|
@ -5141,6 +5151,16 @@ dependencies = [
|
||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "os_pipe"
|
||||||
|
version = "1.1.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0ae859aa07428ca9a929b936690f8b12dc5f11dd8c6992a18ca93919f28bc177"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
"windows-sys 0.48.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "overload"
|
name = "overload"
|
||||||
version = "0.1.1"
|
version = "0.1.1"
|
||||||
|
@ -5287,6 +5307,12 @@ version = "1.0.12"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79"
|
checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pathdiff"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "peeking_take_while"
|
name = "peeking_take_while"
|
||||||
version = "0.1.2"
|
version = "0.1.2"
|
||||||
|
@ -7369,6 +7395,16 @@ dependencies = [
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "shared_child"
|
||||||
|
version = "1.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b0d94659ad3c2137fef23ae75b03d5241d633f8acded53d672decfa0e6e0caef"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
"winapi",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "shlex"
|
name = "shlex"
|
||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
|
@ -8015,16 +8051,20 @@ dependencies = [
|
||||||
"minisign-verify",
|
"minisign-verify",
|
||||||
"objc",
|
"objc",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
|
"open",
|
||||||
"os_info",
|
"os_info",
|
||||||
|
"os_pipe",
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"rand 0.8.5",
|
"rand 0.8.5",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
|
"regex",
|
||||||
"rfd",
|
"rfd",
|
||||||
"semver",
|
"semver",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"serde_repr",
|
"serde_repr",
|
||||||
"serialize-to-javascript",
|
"serialize-to-javascript",
|
||||||
|
"shared_child",
|
||||||
"state",
|
"state",
|
||||||
"tar",
|
"tar",
|
||||||
"tauri-macros",
|
"tauri-macros",
|
||||||
|
@ -8075,6 +8115,7 @@ dependencies = [
|
||||||
"png",
|
"png",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
"regex",
|
||||||
"semver",
|
"semver",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
|
|
@ -9,7 +9,16 @@ repository.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tauri = { version = "1.3.0", features = ["dialog-all", "linux-protocol-headers", "macos-private-api", "os-all"] }
|
tauri = { version = "1.3.0", features = [
|
||||||
|
"dialog-all",
|
||||||
|
"linux-protocol-headers",
|
||||||
|
"macos-private-api",
|
||||||
|
"os-all",
|
||||||
|
"path-all",
|
||||||
|
"protocol-all",
|
||||||
|
"shell-all",
|
||||||
|
"window-all",
|
||||||
|
] }
|
||||||
rspc = { workspace = true, features = ["tauri"] }
|
rspc = { workspace = true, features = ["tauri"] }
|
||||||
httpz = { workspace = true, features = [
|
httpz = { workspace = true, features = [
|
||||||
"axum",
|
"axum",
|
||||||
|
|
|
@ -58,7 +58,17 @@
|
||||||
},
|
},
|
||||||
"allowlist": {
|
"allowlist": {
|
||||||
"all": false,
|
"all": false,
|
||||||
|
"window": {
|
||||||
|
"all": true
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"all": true
|
||||||
|
},
|
||||||
|
"shell": {
|
||||||
|
"all": true
|
||||||
|
},
|
||||||
"protocol": {
|
"protocol": {
|
||||||
|
"all": true,
|
||||||
"assetScope": ["*"]
|
"assetScope": ["*"]
|
||||||
},
|
},
|
||||||
"os": {
|
"os": {
|
||||||
|
|
|
@ -13,7 +13,7 @@ use std::{
|
||||||
sync::Arc,
|
sync::Arc,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(not(target_os = "linux"))]
|
#[cfg(windows)]
|
||||||
use std::cmp::min;
|
use std::cmp::min;
|
||||||
|
|
||||||
use http_range::HttpRange;
|
use http_range::HttpRange;
|
||||||
|
@ -232,12 +232,16 @@ async fn handle_file(
|
||||||
"avi" => "video/x-msvideo",
|
"avi" => "video/x-msvideo",
|
||||||
// MP4 video
|
// MP4 video
|
||||||
"mp4" | "m4v" => "video/mp4",
|
"mp4" | "m4v" => "video/mp4",
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
// FIX-ME: This media types break macOS video rendering
|
||||||
|
// MPEG transport stream
|
||||||
|
"ts" => "video/mp2t",
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
// FIX-ME: This media types break macOS video rendering
|
||||||
// MPEG Video
|
// MPEG Video
|
||||||
"mpeg" => "video/mpeg",
|
"mpeg" => "video/mpeg",
|
||||||
// OGG video
|
// OGG video
|
||||||
"ogv" => "video/ogg",
|
"ogv" => "video/ogg",
|
||||||
// MPEG transport stream
|
|
||||||
"ts" => "video/mp2t",
|
|
||||||
// WEBM video
|
// WEBM video
|
||||||
"webm" => "video/webm",
|
"webm" => "video/webm",
|
||||||
// 3GPP audio/video container (TODO: audio/3gpp if it doesn't contain video)
|
// 3GPP audio/video container (TODO: audio/3gpp if it doesn't contain video)
|
||||||
|
@ -319,7 +323,8 @@ async fn handle_file(
|
||||||
|
|
||||||
// TODO: For some reason webkit2gtk doesn't like this at all.
|
// TODO: For some reason webkit2gtk doesn't like this at all.
|
||||||
// It causes it to only stream random pieces of any given audio file.
|
// It causes it to only stream random pieces of any given audio file.
|
||||||
#[cfg(not(target_os = "linux"))]
|
// TODO: This causes macOS to freeze streaming mp4
|
||||||
|
#[cfg(windows)]
|
||||||
// prevent max_length;
|
// prevent max_length;
|
||||||
// specially on webview2
|
// specially on webview2
|
||||||
if mime_type != "application/pdf" && range.length > file_size / 3 {
|
if mime_type != "application/pdf" && range.length > file_size / 3 {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import { Trash } from 'phosphor-react';
|
import { Trash } from 'phosphor-react';
|
||||||
import { Info } from 'phosphor-react';
|
import { Info } from 'phosphor-react';
|
||||||
import { ChangeEvent, useId } from 'react';
|
import { ChangeEvent, useEffect, useId } from 'react';
|
||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
import { createPortal } from 'react-dom';
|
import { createPortal } from 'react-dom';
|
||||||
import { Controller, FormProvider, useFieldArray } from 'react-hook-form';
|
import { Controller, FormProvider, useFieldArray } from 'react-hook-form';
|
||||||
|
@ -121,7 +121,9 @@ const RulesForm = ({ onSubmitted }: Props) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (form.formState.isSubmitSuccessful) onSubmitted?.();
|
useEffect(() => {
|
||||||
|
if (form.formState.isSubmitSuccessful) onSubmitted?.();
|
||||||
|
}, [form.formState.isSubmitSuccessful, onSubmitted]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
// The portal is required for Form because this component can be nested inside another form element
|
// The portal is required for Form because this component can be nested inside another form element
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
lockfileVersion: '6.0'
|
lockfileVersion: '6.1'
|
||||||
|
|
||||||
|
settings:
|
||||||
|
autoInstallPeers: true
|
||||||
|
excludeLinksFromLockfile: false
|
||||||
|
|
||||||
overrides:
|
overrides:
|
||||||
'@radix-ui/react-dismissable-layer': 1.0.2
|
'@radix-ui/react-dismissable-layer': 1.0.2
|
||||||
|
|
Loading…
Reference in a new issue