Update main.js

This commit is contained in:
Elijah Bansley 2018-05-17 08:37:57 -05:00 committed by GitHub
parent a560c38ecb
commit 71ded9b78b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,13 +107,18 @@ async function launchPayload(payload) {
document.getElementById("goButton").addEventListener("click", async () => { document.getElementById("goButton").addEventListener("click", async () => {
var debugCheckbox = document.getElementById("shouldDebug"); var debugCheckbox = document.getElementById("shouldDebug");
const payloadType = document.forms.mainForm.payload.value;
if(debugCheckbox.checked) { if(debugCheckbox.checked) {
logOutput(payload); if (payloadType === "uploaded") {
const file = document.getElementById("payloadUpload").files[0];
} else if (payloadType === "fusee.bin") {
const file = fusee;
}
logOutput(readFileAsArrayBuffer(file));
} }
logOutput("Requesting access to device..."); logOutput("Requesting access to device...");
device = await navigator.usb.requestDevice({ filters: [{ vendorId: 0x0955 }] }); device = await navigator.usb.requestDevice({ filters: [{ vendorId: 0x0955 }] });
const payloadType = document.forms.mainForm.payload.value;
logOutput(`Preparing to launch ${payloadType}...`); logOutput(`Preparing to launch ${payloadType}...`);
let payload; let payload;