Skip to content

Commit

Permalink
fix: don't double-fire our own mouseup/down evts
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-liang committed May 2, 2022
1 parent 834a78a commit 14a6d73
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/message-actions/client-event.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class ClientEvent {
const data = message.data;

// ignore goto-url and textinput events
if (message.type == 'goto-url' || message.type == 'textinput') {
if (message.type === 'goto-url' || message.type === 'textinput') {
return;
}

Expand Down Expand Up @@ -48,6 +48,9 @@ export class ClientEvent {
}, false);
break;
case 'mousedown':
if (clicker === ARENA.camName) { // ignore clicks from the camera
return;
}
// emit a synthetic click event with ugly data syntax
entityEl.emit('mousedown', {
'clicker': clicker,
Expand All @@ -57,6 +60,9 @@ export class ClientEvent {
}, false);
break;
case 'mouseup':
if (clicker === ARENA.camName) { // ignore clicks from the camera
return;
}
// emit a synthetic click event with ugly data syntax
entityEl.emit('mouseup', {
'clicker': clicker,
Expand Down

0 comments on commit 14a6d73

Please sign in to comment.