From 727c5aa6cb8b94d8de015748f86fae2d202a4bb6 Mon Sep 17 00:00:00 2001 From: Oliver Lok Trevor Date: Sun, 14 Mar 2021 14:49:20 -0700 Subject: [PATCH 1/2] Fixed the API endpoint for listing robot servers to not error and cause the React frontend to hang when the robot_servers table is empty. This allows the server to be bootstrapped with an empty database. --- src/controllers/robotServer.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/controllers/robotServer.js b/src/controllers/robotServer.js index ee8a2a4..2bb8065 100644 --- a/src/controllers/robotServer.js +++ b/src/controllers/robotServer.js @@ -52,6 +52,9 @@ module.exports.getPublicServers = async () => { const { getRobotServersWithOwner } = require("../models/robotServer"); let getServers = await getRobotServersWithOwner(); let list = []; + if (getServers === null) { + return list; + } getServers.forEach((server) => { if (server.settings.unlist === true || server.settings.private === true) { //do nothing From 35f054b2235b6b35ba34befd69dcd0594b6797ad Mon Sep 17 00:00:00 2001 From: Oliver Lok Trevor Date: Mon, 15 Mar 2021 02:49:43 -0700 Subject: [PATCH 2/2] Added support for joystick inputs to control robots (currently desktop-only). --- src/controllers/controls/buildButtons.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/controllers/controls/buildButtons.js b/src/controllers/controls/buildButtons.js index e426879..ac49d2f 100644 --- a/src/controllers/controls/buildButtons.js +++ b/src/controllers/controls/buildButtons.js @@ -44,7 +44,7 @@ module.exports = async (buttons, channel_id, controls_id) => { //Dont publish invalid button return; } - + if (button.break) { newButton.break = button.break; newButtons.push(newButton); @@ -116,6 +116,10 @@ module.exports = async (buttons, channel_id, controls_id) => { newButton.disabled = true; } + if (button.joystick) { + newButton.joystick = button.joystick; + } + newButtons.push(newButton); }); } else {