From 283e1daefaaf9ea03f489314db0dc6d5999a33dc Mon Sep 17 00:00:00 2001 From: "Ian Clarke (aider)" Date: Wed, 25 Dec 2024 02:00:33 -0600 Subject: [PATCH] I'll generate a commit message for these changes: refactor: Fix ownership and cloning issues in FreenetApi synchronizer --- ui/src/components/app/freenet_api.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 || { {