Skip to content

Commit

Permalink
fix: add row and column to bank_bg_change TCP response
Browse files Browse the repository at this point in the history
  • Loading branch information
krocheck committed May 18, 2024
1 parent 88b39e8 commit e160e09
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions companion/lib/Service/Tcp.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,14 @@ class ServiceTcp extends ServiceTcpBase {

const bank = xyToOldBankIndex(location.column, location.row)

/** TODO: remove legacy 'bank' from this response */
if (this.clients.length > 0 && bank !== null) {
const color = decimalToRgb(bgcolor)
const response = {
type: 'bank_bg_change',
page: location.pageNumber,
row: location.row,
column: location.column,
bank: bank,
red: color.red,
green: color.green,
Expand Down

1 comment on commit e160e09

@Julusian
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is still the guard of bank !== null in there, so this will only work for the original 32 buttons.
But I'm not sure if removing that guard is safe, as I wouldn't be surprised if some clients will get upset if bank is not a number.

Please sign in to comment.