Skip to content
Snippets Groups Projects
Verified Commit 4d6ad710 authored by Erick Hitter's avatar Erick Hitter
Browse files

Only ignore queued clicks if they are more than two seconds old, so allow for reconnection delay

parent b449e703
No related branches found
No related tags found
No related merge requests found
...@@ -43,9 +43,15 @@ function listenToButton( bdAddr ) { ...@@ -43,9 +43,15 @@ function listenToButton( bdAddr ) {
client.addConnectionChannel( cc ); client.addConnectionChannel( cc );
cc.on( 'buttonUpOrDown', function( clickType, wasQueued, timeDiff ) { cc.on( 'buttonUpOrDown', function( clickType, wasQueued, timeDiff ) {
if ( 'ButtonDown' === clickType && false === wasQueued ) { if ( 'ButtonDown' !== clickType ) {
buttonActivated( bdAddr ); return;
} }
if ( wasQueued && timeDiff > 2 ) {
return;
}
buttonActivated( bdAddr );
} ); } );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment