Skip to content

Commit

Permalink
fix: upload failure with github (marktext#3588)
Browse files Browse the repository at this point in the history
  • Loading branch information
left0ver committed Mar 6, 2023
1 parent aed36db commit 9d741ea
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/renderer/util/fileSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,11 @@ export const uploadImage = async (pathname, image, preferences) => {
uploadByCommand(currentUploader, reader.result)
break
default:
uploadByGithub(reader.result, image.name)
uploadByGithub(Buffer.from(reader.result).toString('base64'), image.name)
}
}

const readerFunction = currentUploader !== 'github' ? 'readAsArrayBuffer' : 'readAsDataURL'
reader[readerFunction](image)
reader.readAsArrayBuffer(image)
}
}
return promise
Expand Down

0 comments on commit 9d741ea

Please sign in to comment.