From 24b3b7d8b13b596633a46a49b2628e86a7988784 Mon Sep 17 00:00:00 2001 From: vorotamoroz Date: Tue, 26 Apr 2022 18:32:27 +0900 Subject: [PATCH] Fixed: - Note had been corrupted when the passphrase was empty. --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index e26f716..c4956bf 100644 --- a/src/index.ts +++ b/src/index.ts @@ -169,7 +169,7 @@ async function putDBEntry(note: LoadedEntry, passphrase: string, database: Pouch leafid = "h:" + hashedPiece; //have to make - const savePiece = await encrypt(piece, passphrase); + const savePiece = passphrase != "" ? await encrypt(piece, passphrase) : piece; const d: EntryLeaf = { _id: leafid,