Skip to content

Commit

Permalink
avoid resending onActivePlayerChange if nothing has changed (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
gonpombo8 committed Aug 28, 2024
1 parent dd9834a commit 4bbadff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/queue/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export function setNextPlayer() {
Player.getMutable(nextPlayer.entity).startPlayingAt = Date.now()
}

if (listeners.onActivePlayerChange) {
if (listeners.onActivePlayerChange && activePlayer?.address !== nextPlayer?.player.address) {
listeners.onActivePlayerChange(Player.getOrNull(nextPlayer?.entity))
}
}
Expand Down

0 comments on commit 4bbadff

Please sign in to comment.