From 4fb398d56c5ef8781cdd7207cc43c34de1338106 Mon Sep 17 00:00:00 2001 From: Ian Clarke Date: Sat, 21 Dec 2024 14:09:36 -0600 Subject: [PATCH] refactor: Make subscribe method async and send contract request --- ui/src/components/app/freenet_api.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/src/components/app/freenet_api.rs b/ui/src/components/app/freenet_api.rs index b989367..6a46dad 100644 --- a/ui/src/components/app/freenet_api.rs +++ b/ui/src/components/app/freenet_api.rs @@ -134,14 +134,14 @@ impl FreenetApiSynchronizer { } /// Subscribes to a chat room owned by the specified room owner. - pub fn subscribe(&mut self, room_owner: &VerifyingKey) { + pub async fn subscribe(&mut self, room_owner: &VerifyingKey) { log::info!("Subscribing to chat room owned by {:?}", room_owner); let parameters = Self::prepare_chat_room_parameters(room_owner); let contract_key = Self::generate_contract_key(parameters); - let _subscribe_request = ContractRequest::Subscribe { + let subscribe_request = ContractRequest::Subscribe { key: contract_key, summary: None, }; - // self.web_api.send_request(subscribe_request); + self.sender.request_sender.send(subscribe_request.into()).await.expect("Unable to send request"); } }