diff --git a/ui/src/components/app/freenet_api.rs b/ui/src/components/app/freenet_api.rs index d1ab82f..f0a2275 100644 --- a/ui/src/components/app/freenet_api.rs +++ b/ui/src/components/app/freenet_api.rs @@ -51,8 +51,9 @@ impl FreenetApiSynchronizer { // Start the sync coroutine use_coroutine(move |mut rx| { - let request_sender_clone = request_sender.clone(); - async move { + let request_sender = request_sender.clone(); + { + async move { *SYNC_STATUS.write() = SyncStatus::Connecting; let websocket_connection = match web_sys::WebSocket::new(WEBSOCKET_URL) { @@ -88,7 +89,7 @@ impl FreenetApiSynchronizer { // Watch for changes to Rooms signal let rooms = use_context::>(); - let request_sender_clone = request_sender.clone(); + let request_sender = request_sender.clone(); use_effect(move || { {