Fixed bug with object key-value.

This commit is contained in:
Christian Bastian
2024-07-24 02:36:35 -04:00
parent 7e60dbe827
commit 5d7ffb0cf3

View File

@@ -23,11 +23,10 @@ function request(url, options = undefined) {
async function loadWorkflow(url) {
const uri = (new URL(url)).searchParams.get("uri");
const fileNameIndex = Math.max(uri.lastIndexOf("/"), uri.lastIndexOf("\\")) + 1;
const fileName = uri.substring(fileNameIndex);
const fileName = uri.substring(0, fileNameIndex);
const response = await fetch(url);
const data = await response.blob();
const datatype = data.type;
const file = new File([data], fileName, { datatype });
const file = new File([data], fileName, { type: data.type });
app.handleFile(file);
}