Skip to content

Commit

Permalink
fix: emberplus server
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Jun 29, 2023
1 parent ecdd86c commit 6d0cfd2
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions lib/Service/EmberPlus.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,10 @@ class ServiceEmberPlus extends ServiceBase {
let bank = parseInt(pathInfo[3])

if (!isNaN(page) && !isNaN(bank) && page > 0 && page < 100) {
this.logger.silly('Change bank ' + page + '.' + bank + ' to', value)
this.bank.action.pressBank(page, bank, value, 'emberplus')
const controlId = CreateBankControlId(page, bank)
this.logger.silly(`Change bank ${controlId} text to`, value)

this.controls.pressControl(controlId, !!value, `emberplus`)
this.server.update(parameter, { value })
return true
}
Expand All @@ -214,13 +216,15 @@ class ServiceEmberPlus extends ServiceBase {
let bank = parseInt(pathInfo[3])

if (!isNaN(page) && !isNaN(bank) && page > 0 && page < 100) {
this.logger.silly('Change bank ' + page + '.' + bank + ' text to', value)
if (this.banks[page] && this.banks[page][bank]) {
if (value !== this.banks[page][bank].text) {
this.bank.changeField(page, bank, 'text', value)
this.server.update(parameter, { value })
return true
}
const controlId = CreateBankControlId(page, bank)
this.logger.silly(`Change bank ${controlId} text to`, value)

const control = this.controls.getControl(controlId)
if (control && typeof control.styleSetFields === 'function') {
control.styleSetFields({ text: value })
// Note: this will be replaced shortly after with the value with feedbacks applied
this.server.update(parameter, { value })
return true
}
}
}
Expand Down

0 comments on commit 6d0cfd2

Please sign in to comment.