Browse Source

Fix the mobile feature on the dioxus crate (#2185)

Evan Almloff 1 year ago
parent
commit
4a622348f2
2 changed files with 13 additions and 6 deletions
  1. 1 1
      Cargo.lock
  2. 12 5
      packages/dioxus/src/launch.rs

+ 1 - 1
Cargo.lock

@@ -2143,7 +2143,7 @@ dependencies = [
 
 [[package]]
 name = "dioxus-cli"
-version = "0.5.0"
+version = "0.5.4"
 dependencies = [
  "anyhow",
  "atty",

+ 12 - 5
packages/dioxus/src/launch.rs

@@ -182,11 +182,15 @@ impl<Cfg: Default + 'static, ContextFn: ?Sized> LaunchBuilder<Cfg, ContextFn> {
 /// - `liveview`
 mod current_platform {
     macro_rules! if_else_cfg {
-        (if $attr:meta { $then:item } else { $else:item }) => {
-            #[cfg($attr)]
-            $then
-            #[cfg(not($attr))]
-            $else
+        (if $attr:meta { $($then:item)* } else { $($else:item)* }) => {
+            $(
+                #[cfg($attr)]
+                $then
+            )*
+            $(
+                #[cfg(not($attr))]
+                $else
+            )*
         };
     }
     use crate::prelude::TryIntoConfig;
@@ -194,7 +198,10 @@ mod current_platform {
     #[cfg(any(feature = "desktop", feature = "mobile"))]
     if_else_cfg! {
         if not(feature = "fullstack") {
+            #[cfg(feature = "desktop")]
             pub use dioxus_desktop::launch::*;
+            #[cfg(not(feature = "desktop"))]
+            pub use dioxus_mobile::launch::*;
         } else {
             impl TryIntoConfig<crate::launch::current_platform::Config> for ::dioxus_desktop::Config {
                 fn into_config(self) -> Option<crate::launch::current_platform::Config> {