Skip to content

Commit

Permalink
Fix issue with registering multiple event listeners for a single event
Browse files Browse the repository at this point in the history
  • Loading branch information
onerain88 committed Oct 15, 2024
1 parent 2ec9087 commit d0cdf70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cocos/native-binding/impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ if (NATIVE) {
this.eventMap.set(eventName, []);
}
const arr = this.eventMap.get(eventName);
if (!arr.find(listener)) {
if (!arr.includes(listener)) {
arr.push(listener);
}
},
Expand Down

0 comments on commit d0cdf70

Please sign in to comment.