diff --git a/gui/Cargo.toml b/gui/Cargo.toml index 1560368..f38ca1c 100644 --- a/gui/Cargo.toml +++ b/gui/Cargo.toml @@ -97,8 +97,8 @@ dioxus-asset-resolver = "0.7.2" # Platform Integration # ==================== # rfd only supports windows, macos, linux, and wasm32. No support for Android or iOS -[target.'cfg(any(target_os = "linux", target_os = "windows", target_os = "macos", target_arch = "wasm32"))'.dependencies] -rfd = { git = "https://github.com/PolyMeilex/rfd.git", version = "^0.16.0", default-features = false } +#[target.'cfg(any(target_os = "linux", target_os = "windows", target_os = "macos", target_arch = "wasm32"))'.dependencies] +rfd = { git = "https://github.com/PolyMeilex/rfd.git", version = "^0.16.0", default-features = false, optional = true } # Denoising # ========= @@ -126,6 +126,7 @@ web = [ "gloo-timers", "tracing-web", "deep_filter/wasm", + "rfd", ] desktop = [ "dioxus/desktop", @@ -138,3 +139,13 @@ desktop = [ "rfd/xdg-portal", "etcetera", ] + +mobile = [ + "dioxus/mobile", + "tokio", + "tokio-rustls", + "tracing-subscriber/env-filter", + "opus", + "cpal", + "dasp_ring_buffer", +] diff --git a/gui/src/app.rs b/gui/src/app.rs index 70fce42..6089df4 100644 --- a/gui/src/app.rs +++ b/gui/src/app.rs @@ -210,12 +210,7 @@ pub fn Channel(id: ChannelId) -> Element { ) } -#[cfg(any( - target_os = "windows", - target_os = "macos", - target_os = "linux", - target_arch = "wasm32", -))] +#[cfg(any(feature = "desktop", feature = "web"))] pub fn pick_and_send_file(net: &Coroutine) { let channels = if let Some(user) = STATE.server.read().this_user() { vec![user.channel] @@ -237,12 +232,7 @@ pub fn pick_and_send_file(net: &Coroutine) { }); }); } -#[cfg(not(any( - target_os = "windows", - target_os = "macos", - target_os = "linux", - target_arch = "wasm32", -)))] +#[cfg(not(any(feature = "desktop", feature = "web")))] pub fn pick_and_send_file(net: &Coroutine) {} #[component] diff --git a/gui/src/imp/mod.rs b/gui/src/imp/mod.rs index ae5f314..59b2095 100644 --- a/gui/src/imp/mod.rs +++ b/gui/src/imp/mod.rs @@ -1,11 +1,11 @@ #[cfg(feature = "web")] mod web; -#[cfg(feature = "desktop")] +#[cfg(any(feature = "desktop", feature = "android"))] mod desktop; -#[cfg(all(feature = "web", not(feature = "desktop")))] +#[cfg(all(feature = "web", not(any(feature = "desktop", feature = "android"))))] pub use web::*; -#[cfg(feature = "desktop")] +#[cfg(any(feature = "desktop", feature = "android"))] pub use desktop::*;