diff --git a/app.js b/app.js index c27d9da..e61492c 100644 --- a/app.js +++ b/app.js @@ -59,14 +59,12 @@ function downloadBinaryFile(data, filename) { }, 100); } -export async function createBinary() { +export async function createBinary(logoFile, loaderFile) { const BRAND_NAME = "TRMNL"; const API_URL = "https://trmnl.app"; - const logo = document.getElementById('logo-input'); - const loader = document.getElementById('loader-input'); - const logoBinary = await encodePNG(logo.files[0]); - const loaderBinary = await encodePNG(loader.files[0]); + const logoBinary = await encodePNG(logoFile); + const loaderBinary = await encodePNG(loaderFile); const totalLength = logoBinary.length + loaderBinary.length; if (totalLength > IMAGES_SIZE) { diff --git a/index.html b/index.html index cfb4286..ed8b989 100644 --- a/index.html +++ b/index.html @@ -169,7 +169,7 @@ btn.disabled = true; try { - const blob = await createBinary(); + const blob = await createBinary(state.logo.file, state.loader.file); const manifest = { name: "TRMNL Firmware", new_install_prevent_erase: true,