15 lines
470 B
Rust
Raw Normal View History

2022-01-07 17:37:11 +08:00
use crate::{entities::NetworkState, services::ws_conn::FlowyWebSocketConnect};
2021-12-14 15:31:44 +08:00
use flowy_error::FlowyError;
use lib_dispatch::prelude::{Data, Unit};
use std::sync::Arc;
#[tracing::instrument(skip(data, ws_manager))]
2021-12-26 19:10:37 +08:00
pub async fn update_network_ty(
data: Data<NetworkState>,
2022-01-07 17:37:11 +08:00
ws_manager: Unit<Arc<FlowyWebSocketConnect>>,
2021-12-26 19:10:37 +08:00
) -> Result<(), FlowyError> {
2021-12-14 15:31:44 +08:00
let network_state = data.into_inner();
ws_manager.update_network_type(&network_state.ty);
Ok(())
}