promisify data

This commit is contained in:
fyears
2021-11-03 00:15:23 +08:00
parent cef623f493
commit 6431182ec3
3 changed files with 28 additions and 23 deletions
+2 -2
View File
@@ -109,7 +109,7 @@ export const uploadToRemote = async (
const localContent = await vault.adapter.readBinary(fileOrFolderPath);
let remoteContent = localContent;
if (password !== "") {
remoteContent = encryptArrayBuffer(localContent, password);
remoteContent = await encryptArrayBuffer(localContent, password);
}
const body = arrayBufferToBuffer(remoteContent);
await s3Client.send(
@@ -214,7 +214,7 @@ export const downloadFromRemote = async (
);
let localContent = remoteContent;
if (password !== "") {
localContent = decryptArrayBuffer(remoteContent, password);
localContent = await decryptArrayBuffer(remoteContent, password);
}
await vault.adapter.writeBinary(fileOrFolderPath, localContent, {
mtime: mtime,