This commit is contained in:
left0ver 2024-06-13 15:47:07 +07:00 committed by GitHub
commit 58ff1ce491
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -227,12 +227,11 @@ export const uploadImage = async (pathname, image, preferences) => {
uploadByCommand(currentUploader, reader.result) uploadByCommand(currentUploader, reader.result)
break break
default: default:
uploadByGithub(reader.result, image.name) uploadByGithub(Buffer.from(reader.result).toString('base64'), image.name)
} }
} }
const readerFunction = currentUploader !== 'github' ? 'readAsArrayBuffer' : 'readAsDataURL' reader.readAsArrayBuffer(image)
reader[readerFunction](image)
} }
} }
return promise return promise