From 2b808a1bce251fa7dcd7027a9aa121d09cce5d85 Mon Sep 17 00:00:00 2001 From: "Ian Clarke (aider)" Date: Wed, 25 Dec 2024 01:57:13 -0600 Subject: [PATCH] feat: Fix ownership issue with request_sender in FreenetApiSynchronizer --- ui/src/components/app/freenet_api.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ui/src/components/app/freenet_api.rs b/ui/src/components/app/freenet_api.rs index 2acd00f..822e7b2 100644 --- a/ui/src/components/app/freenet_api.rs +++ b/ui/src/components/app/freenet_api.rs @@ -47,13 +47,10 @@ impl FreenetApiSynchronizer { pub fn start() -> Self { let subscribed_contracts = HashSet::new(); let (request_sender, _request_receiver) = futures::channel::mpsc::unbounded(); - let request_sender_for_api = request_sender.clone(); - - let _sender = FreenetApiSender { request_sender: request_sender.clone() }; + let sender_for_struct = request_sender.clone(); // Start the sync coroutine use_coroutine(move |mut rx| { - let request_sender = request_sender.clone(); async move { *SYNC_STATUS.write() = SyncStatus::Connecting; @@ -194,7 +191,7 @@ impl FreenetApiSynchronizer { || {}, ), subscribed_contracts, - sender: FreenetApiSender { request_sender }, + sender: FreenetApiSender { request_sender: sender_for_struct }, } }