From 7b6e5b5eac6ea562251c24f9d359136f8dcde189 Mon Sep 17 00:00:00 2001 From: "Github Action (authored by pmalacho-mit)" Date: Tue, 10 Dec 2024 01:08:50 -0800 Subject: [PATCH] ensuring only the ip is required --- extensions/src/doodlebot/index.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/extensions/src/doodlebot/index.ts b/extensions/src/doodlebot/index.ts index 48badfe00..ae3d351ef 100644 --- a/extensions/src/doodlebot/index.ts +++ b/extensions/src/doodlebot/index.ts @@ -94,10 +94,18 @@ export default class DoodlebotBlocks extends extension(details, "ui", "indicator const commandCompleteIdentifier = "done"; const urlParams = new URLSearchParams(window.location.search); // Hack for now + + const ip = urlParams.get("ip"); + + if (!ip) { + alert("No IP address provided. Please provide an IP address in the URL query string."); + return; + } + const networkCredentials: NetworkCredentials = { - ssid: urlParams.get("ssid"), - password: urlParams.get("password"), - ipOverride: urlParams.get("ip").trim() === "" ? null : urlParams.get("ip") + ssid: "dummy", // NOTE: When using the external BLE, it is assumed a valid ip address will be provided, and thus there is no need for wifi credentials + password: "dummy", // NOTE: When using the external BLE, it is assumed a valid ip address will be provided, and thus there is no need for wifi credentials + ipOverride: ip } type ExternalPageDetails = { source: MessageEventSource, targetOrigin: string }