refactor: less ack noise

This commit is contained in:
cha0s 2021-01-18 18:23:20 -06:00
parent b08fc24c5f
commit 10a679bea4

View File

@ -6,7 +6,10 @@ export default (socket) => async (packet, fn) => {
const Packet = packet.constructor; const Packet = packet.constructor;
try { try {
await Packet.validate(packet, socket); await Packet.validate(packet, socket);
fn(undefined, await Packet.respond(packet, socket)); const response = await Packet.respond(packet, socket);
if ('undefined' !== typeof response) {
fn(undefined, response);
}
} }
catch (error) { catch (error) {
if (error.payload) { if (error.payload) {