mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
core: writeEncrypted now accepts only base64 input
This commit is contained in:
committed by
Abdullah Atta
parent
fa4a298bfa
commit
7a773937c2
@@ -285,10 +285,8 @@ export default class Attachments extends Collection {
|
|||||||
|
|
||||||
async save(data, type, mimeType) {
|
async save(data, type, mimeType) {
|
||||||
const key = await this._db.attachments.generateKey();
|
const key = await this._db.attachments.generateKey();
|
||||||
const metadata = await this._db.fs.writeEncrypted(
|
const metadata = await this._db.fs.writeEncryptedBase64(
|
||||||
null,
|
|
||||||
data,
|
data,
|
||||||
type,
|
|
||||||
key,
|
key,
|
||||||
mimeType
|
mimeType
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -73,10 +73,9 @@ export default class FileStorage {
|
|||||||
return this.fs.readEncrypted(filename, encryptionKey, cipherData);
|
return this.fs.readEncrypted(filename, encryptionKey, cipherData);
|
||||||
}
|
}
|
||||||
|
|
||||||
writeEncrypted(filename, data, type, encryptionKey, mimeType) {
|
writeEncryptedBase64(data, encryptionKey, mimeType) {
|
||||||
return this.fs.writeEncrypted(filename, {
|
return this.fs.writeEncryptedBase64({
|
||||||
data,
|
data,
|
||||||
type,
|
|
||||||
key: encryptionKey,
|
key: encryptionKey,
|
||||||
mimeType
|
mimeType
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user