mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-11 03:24: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")
|
||||
}
|
||||
|
||||
return await new Promise((resolve, reject) => {
|
||||
if (eventFile.type === "text/html") {
|
||||
eventFile.getAsString((data) => {
|
||||
const parser = new DOMParser()
|
||||
@ -53,6 +54,7 @@ export default async (eventFile) => {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return eventFile.getAsFile()
|
||||
return resolve(eventFile.getAsFile())
|
||||
}
|
||||
})
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user