From 4da91b44278914c3887870184010e19ae7360768 Mon Sep 17 00:00:00 2001 From: Maccesch Date: Mon, 19 Feb 2024 23:14:33 +0000 Subject: [PATCH] Removed signal warnings from `use_websocket`'s `send...` methods --- CHANGELOG.md | 4 ++++ src/use_websocket.rs | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd8f7af..71727d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - +### Fix 🍕 + +- Removed signal warnings from `use_websocket`'s `send...` methods. + ### Changes 🔥 - `use_color_mode` now supports detection from an url query parameter. (thanks to @mondeja) diff --git a/src/use_websocket.rs b/src/use_websocket.rs index 9f40d4f..24ec201 100644 --- a/src/use_websocket.rs +++ b/src/use_websocket.rs @@ -402,7 +402,7 @@ pub fn use_websocket_with_options( // Send text (String) let send = { Box::new(move |data: &str| { - if ready_state.get() == ConnectionReadyState::Open { + if ready_state.get_untracked() == ConnectionReadyState::Open { if let Some(web_socket) = ws_ref.get_value() { let _ = web_socket.send_with_str(data); } @@ -412,7 +412,7 @@ pub fn use_websocket_with_options( // Send bytes let send_bytes = move |data: Vec| { - if ready_state.get() == ConnectionReadyState::Open { + if ready_state.get_untracked() == ConnectionReadyState::Open { if let Some(web_socket) = ws_ref.get_value() { let _ = web_socket.send_with_u8_array(&data); }