fix: do not show command data in logs

This commit is contained in:
Vlad Stan 2022-09-27 17:19:32 +03:00
parent 2b56efa2b6
commit 649c653836

View file

@ -230,8 +230,9 @@ async function serialSigner(path) {
while (true) { while (true) {
const {value, done} = await readStringUntil('\n') const {value, done} = await readStringUntil('\n')
if (value) { if (value) {
this.handleSerialPortResponse(value) const {command, commandData} = await this.extractCommand(value)
this.updateSerialPortConsole(value) this.handleSerialPortResponse(command, commandData)
this.updateSerialPortConsole(command)
} }
if (done) return if (done) return
} }
@ -245,8 +246,7 @@ async function serialSigner(path) {
} }
} }
}, },
handleSerialPortResponse: async function (value) { handleSerialPortResponse: async function (command, commandData) {
const {command, commandData} = await this.extractCommand(value)
this.logPublicCommandsResponse(command, commandData) this.logPublicCommandsResponse(command, commandData)
switch (command) { switch (command) {
@ -287,7 +287,7 @@ async function serialSigner(path) {
) )
break break
default: default:
console.log(` %c${value}`, 'background: #222; color: red') console.log(` %c${command}`, 'background: #222; color: red')
} }
}, },
logPublicCommandsResponse: function (command, commandData) { logPublicCommandsResponse: function (command, commandData) {