Skip to content

Commit

Permalink
Fix the mobile feature on the dioxus crate (#2185)
Browse files Browse the repository at this point in the history
  • Loading branch information
ealmloff authored Mar 30, 2024
1 parent d16ac4e commit 4a62234
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 12 additions & 5 deletions packages/dioxus/src/launch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,19 +182,26 @@ 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;

#[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> {
Expand Down

0 comments on commit 4a62234

Please sign in to comment.