mirror of
https://github.com/Jellify-Music/App.git
synced 2026-04-22 01:28:28 -05:00
I promise
This commit is contained in:
@@ -32,14 +32,15 @@ export async function fetchItemImage(
|
||||
})
|
||||
.then(async ({ data } : { data: Blob }) => {
|
||||
|
||||
console.debug(URL.createObjectURL(data));
|
||||
FileSystem.writeFile(
|
||||
getImagePath(itemId, imageType, width, height),
|
||||
await data.text()
|
||||
).then(() => {
|
||||
resolve(URL.createObjectURL(data));
|
||||
})
|
||||
|
||||
data.text()
|
||||
.then((text) => {
|
||||
FileSystem.writeFile(
|
||||
getImagePath(itemId, imageType, width, height),
|
||||
text
|
||||
).then(() => {
|
||||
resolve(URL.createObjectURL(data));
|
||||
})
|
||||
})
|
||||
})
|
||||
.catch(error => {
|
||||
reject(error)
|
||||
|
||||
Reference in New Issue
Block a user