mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-12 12:04:16 +00:00
fix promise
This commit is contained in:
parent
15a6126feb
commit
9a928e8a7f
@ -3,6 +3,7 @@ export default async (eventFile) => {
|
|||||||
throw new Error("Missing eventFile")
|
throw new Error("Missing eventFile")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return await new Promise((resolve, reject) => {
|
||||||
if (eventFile.type === "text/html") {
|
if (eventFile.type === "text/html") {
|
||||||
eventFile.getAsString((data) => {
|
eventFile.getAsString((data) => {
|
||||||
const parser = new DOMParser()
|
const parser = new DOMParser()
|
||||||
@ -53,6 +54,7 @@ export default async (eventFile) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
return eventFile.getAsFile()
|
return resolve(eventFile.getAsFile())
|
||||||
}
|
}
|
||||||
|
})
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user