From 71ded9b78b0f70116a0f4d44caf015f202d7dcb3 Mon Sep 17 00:00:00 2001 From: Elijah Bansley Date: Thu, 17 May 2018 08:37:57 -0500 Subject: [PATCH] Update main.js --- main.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index 76e7849..3e25928 100644 --- a/main.js +++ b/main.js @@ -107,13 +107,18 @@ async function launchPayload(payload) { document.getElementById("goButton").addEventListener("click", async () => { var debugCheckbox = document.getElementById("shouldDebug"); + const payloadType = document.forms.mainForm.payload.value; 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..."); device = await navigator.usb.requestDevice({ filters: [{ vendorId: 0x0955 }] }); - const payloadType = document.forms.mainForm.payload.value; logOutput(`Preparing to launch ${payloadType}...`); let payload;