Skip to content

Commit

Permalink
ensuring only the ip is required
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalacho-mit committed Dec 10, 2024
1 parent 3679c04 commit 7b6e5b5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions extensions/src/doodlebot/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit 7b6e5b5

Please sign in to comment.