Stop using pointers for button labels

pull/1/head
cpsdqs 7 years ago
parent 3d93cd3690
commit f5bbb60468
Signed by untrusted user: cpsdqs
GPG Key ID: 3F59586BB7448DD1
  1. 11
      js/term/buttons.js
  2. 1
      js/term/connection.js
  3. 6
      js/term/index.js

@ -60,5 +60,14 @@ module.exports = function initButtons (input) {
}
}
return { update, labels }
return {
update,
get labels () {
return labels
},
set labels (value) {
labels = value
update()
}
}
}

@ -145,7 +145,6 @@ module.exports = class TermConnection extends EventEmitter {
return true // Simulate success
}
if (this.xoff) {
// TODO queue
console.log("Can't send, flood control. Queueing")
this.queue.push(message)
return false

@ -20,11 +20,7 @@ module.exports = function (opts) {
input.termUpload = termUpload
const buttons = initButtons(input)
screen.on('button-labels', labels => {
// TODO: don't use pointers for this
buttons.labels.splice(0, buttons.labels.length, ...labels)
buttons.update()
})
screen.on('button-labels', labels => { buttons.labels = labels })
screen.on('TEMP:hide-load-failed-msg', () => {
let scr = qs('#screen')

Loading…
Cancel
Save