Skip to content

Commit ab5dd99

Browse files
committed
fix update pos
1 parent 88652a5 commit ab5dd99

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/service.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ impl Service {
231231
event = emulation.event() => match event {
232232
EmulationEvent::Connected { addr, pos, fingerprint } => {
233233
// check if already registered
234-
if self.incoming_conns.borrow_mut().insert(addr) {
234+
if !self.incoming_conns.borrow_mut().contains(&addr) {
235235
self.add_incoming(addr, pos, fingerprint.clone(), &capture);
236236
self.notify_frontend(FrontendEvent::IncomingConnected(fingerprint, addr, pos));
237237
} else {
@@ -343,6 +343,7 @@ impl Service {
343343
let handle = Self::ENTER_HANDLE_BEGIN + self.next_trigger_handle;
344344
self.next_trigger_handle += 1;
345345
capture.create(handle, pos);
346+
self.incoming_conns.borrow_mut().insert(addr);
346347
self.incoming_conn_info.borrow_mut().insert(
347348
handle,
348349
Incoming {

0 commit comments

Comments
 (0)