This commit is contained in:
parent
c1761aae2b
commit
c7a57a851e
1 changed files with 8 additions and 4 deletions
|
|
@ -76,12 +76,16 @@ fn route_incoming_frame(
|
||||||
let Some(message_type) = message_type else {
|
let Some(message_type) = message_type else {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
for (_, (subscription_type, callback)) in subscriptions.borrow().iter() {
|
let callbacks: Vec<js_sys::Function> = subscriptions
|
||||||
if subscription_type == &message_type {
|
.borrow()
|
||||||
|
.iter()
|
||||||
|
.filter(|(_, (t, _))| t == &message_type)
|
||||||
|
.map(|(_, (_, cb))| cb.clone())
|
||||||
|
.collect();
|
||||||
|
for callback in callbacks {
|
||||||
let _ = callback.call1(&JsValue::NULL, frame);
|
let _ = callback.call1(&JsValue::NULL, frame);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn stop_ping_timer(ping_timer: &Rc<RefCell<Option<PingTimer>>>) {
|
fn stop_ping_timer(ping_timer: &Rc<RefCell<Option<PingTimer>>>) {
|
||||||
let Some(timer) = ping_timer.borrow_mut().take() else {
|
let Some(timer) = ping_timer.borrow_mut().take() else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue