File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " freenet-stdlib"
3- version = " 0.1.21 "
3+ version = " 0.1.22 "
44edition = " 2021"
55rust-version = " 1.71.1"
66publish = true
Original file line number Diff line number Diff line change @@ -88,8 +88,11 @@ impl WebApi {
8888 conn. set_onerror ( Some ( onerror_callback. as_ref ( ) . unchecked_ref ( ) ) ) ;
8989 onerror_callback. forget ( ) ;
9090
91+ let onopen_handler = Rc :: new ( RefCell :: new ( Some ( onopen_handler) ) ) ;
9192 let onopen_callback = Closure :: wrap ( Box :: new ( move || {
92- onopen_handler ( ) ;
93+ if let Some ( handler) = onopen_handler. borrow_mut ( ) . take ( ) {
94+ handler ( ) ;
95+ }
9396 } ) as Box < dyn FnMut ( ) > ) ;
9497 // conn.add_event_listener_with_callback("open", onopen_callback.as_ref().unchecked_ref());
9598 conn. set_onopen ( Some ( onopen_callback. as_ref ( ) . unchecked_ref ( ) ) ) ;
You can’t perform that action at this time.
0 commit comments