Skip to content

Commit

Permalink
refactor: Simplify coroutine closure structure in FreenetApi synchron…
Browse files Browse the repository at this point in the history
…izer
  • Loading branch information
sanity committed Dec 25, 2024
1 parent 283e1da commit 3109c7d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions ui/src/components/app/freenet_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ impl FreenetApiSynchronizer {
let sender_for_struct = request_sender.clone();

// Start the sync coroutine
use_coroutine(move |mut rx| {
use_coroutine(move |mut rx| 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) {
Expand Down Expand Up @@ -182,7 +180,6 @@ impl FreenetApiSynchronizer {
}
}
}
}
});

Self {
Expand Down

0 comments on commit 3109c7d

Please sign in to comment.