mirror of
https://github.com/adoyle0/leptos-use.git
synced 2025-02-08 21:33:09 -05:00
12 lines
332 B
Rust
12 lines
332 B
Rust
use crate::use_window;
|
|
use lazy_static::lazy_static;
|
|
|
|
lazy_static! {
|
|
pub static ref IS_IOS: bool = if let Some(Ok(user_agent)) =
|
|
use_window().navigator().map(|n| n.user_agent())
|
|
{
|
|
user_agent.contains("iPhone") || user_agent.contains("iPad") || user_agent.contains("iPod")
|
|
} else {
|
|
false
|
|
};
|
|
}
|