mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: NetworkType null safety issues (#1435)
* fix: Networktype null safety issues Networktype returns nulls when the connectivity result is vpn resulting to null safety issues. Implemented a case for when the connectivity result is vpn to resolve this issue. * chore: update connectivity_plus_platform_interface ^1.2.2 * chore: update network state on Rust side Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
This commit is contained in:
committed by
GitHub
parent
dd1dcba599
commit
a1e0282df0
@ -6,15 +6,15 @@ pub enum NetworkType {
|
||||
Wifi = 1,
|
||||
Cell = 2,
|
||||
Ethernet = 3,
|
||||
Bluetooth = 4,
|
||||
VPN = 5,
|
||||
}
|
||||
|
||||
impl NetworkType {
|
||||
pub fn is_connect(&self) -> bool {
|
||||
match self {
|
||||
NetworkType::UnknownNetworkType => false,
|
||||
NetworkType::Wifi => true,
|
||||
NetworkType::Cell => true,
|
||||
NetworkType::Ethernet => true,
|
||||
NetworkType::UnknownNetworkType | NetworkType::Bluetooth => false,
|
||||
NetworkType::Wifi | NetworkType::Cell | NetworkType::Ethernet | NetworkType::VPN => true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user