mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
15 lines
473 B
Rust
15 lines
473 B
Rust
use crate::{entities::NetworkState, ws::connection::FlowyWebSocketConnect};
|
|
use flowy_error::FlowyError;
|
|
use lib_dispatch::prelude::{AppData, Data};
|
|
use std::sync::Arc;
|
|
|
|
#[tracing::instrument(skip(data, ws_manager))]
|
|
pub async fn update_network_ty(
|
|
data: Data<NetworkState>,
|
|
ws_manager: AppData<Arc<FlowyWebSocketConnect>>,
|
|
) -> Result<(), FlowyError> {
|
|
let network_state = data.into_inner();
|
|
ws_manager.update_network_type(&network_state.ty);
|
|
Ok(())
|
|
}
|