_hisses in exasperation_

This commit is contained in:
Baud 2024-05-31 00:28:41 +01:00
parent cbb2c64bf6
commit 8c38320062
1 changed files with 21 additions and 15 deletions

View File

@ -90,9 +90,12 @@ function handle_message(message: Partial<WebSocketMessage>) {
hyperdeckId: message.id, hyperdeckId: message.id,
state: transportInfo.status, state: transportInfo.status,
}) })
}) }).catch(() => {})
}) }, 1000)
let connected = false;
while (!connected) {
try {
newHyperdeck.sendCommand(new Commands.DeviceInfoCommand()).then((info) => { newHyperdeck.sendCommand(new Commands.DeviceInfoCommand()).then((info) => {
for (let index = 0; index < info.slots; index++) { for (let index = 0; index < info.slots; index++) {
setInterval(() => { setInterval(() => {
@ -103,10 +106,13 @@ function handle_message(message: Partial<WebSocketMessage>) {
slotId: slot.slotId, slotId: slot.slotId,
remaining: slot.recordingTime remaining: slot.recordingTime
}) })
}) }).catch(() => {})
}) }, 1000)
connected = true;
} }
}) })
} catch (_err) {}
}
}) })
newHyperdeck.on('notify.slot', function (slot) { newHyperdeck.on('notify.slot', function (slot) {